﻿using System;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Web.Security;
using System.Web.SessionState;
using System.Net;
using System.Configuration;
using System.IO;
using System.Text;
using System.Data.OleDb;

public partial class data_system : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string methodName = Request["method"];
        if (string.IsNullOrEmpty(methodName)) return;
        if(CheckLogined())
        {
            int pageid = 0;
            if (int.TryParse(methodName, out pageid))
            {
                bool flg = new sql().CheckPower(Session["su_no"].ToString(), pageid.ToString());
                if (!flg)
                    Response.Write("no");
            }
            else
            {
                Type type = this.GetType();
                MethodInfo method = type.GetMethod(methodName);
                method.Invoke(this, null);
            }
        }
        else
            Response.Write("out");
    }

    /******************登录系统信息********************/
    /// <summary>
    /// 是否登录
    /// </summary>
    /// <returns></returns>
    private bool CheckLogined()
    {
        bool res = false;
        if (Session["su_no"] != null)
        {
            try
            {
                int su_no = Convert.ToInt32(Session["su_no"]);
                Session["su_no"] = su_no;
                string su_login = Convert.ToString(Session["su_login"]);
                Session["su_login"] = su_login;
                string su_power = Convert.ToString(Session["su_power"]);
                Session["su_power"] = su_power;
                res = true;
            }
            catch (Exception e)
            {
                res = false;
            }
        }
        return (res);
    }

    /// <summary>
    /// 注销
    /// </summary>
    public void LogOut()
    {
        new sql().Logout(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress);
        Session.Clear();
        Response.Write(1);
    }

    /// <summary>
    /// 权限菜单
    /// </summary>
    public void GetMenu()
    {
        DataTable datatable = new sql().GetMenu(Session["su_power"].ToString());
        string json = JSON.Encode(datatable);
        Response.Write(json);
    }

    /// <summary>
    /// 权限树
    /// </summary>
    public void GetMenuTree()
    {
        string id = Request["id"];
        if (string.IsNullOrEmpty(id))
        {
            DataTable datatable = new sql().GetMenuTree();
            string json = JSON.Encode(datatable);
            Response.Write(json);
        }
        else
        {
            DataTable datatable = new sql().GetMenuTree(id);
            string json = JSON.Encode(datatable);
            Response.Write(json);
        }
    }

    /// <summary>
    /// 登录账户信息
    /// </summary>
    public void GetLoginInfor()
    {
        Hashtable user = new sql().GetUser(Session["su_no"].ToString());
        string json = JSON.Encode(user);
        Response.Write(json);
    }

    /// <summary>
    /// 修改密码
    /// </summary>
    public void ChangePW()
    {
        string json = Request["data"];
        Hashtable data = (Hashtable)JSON.Decode(json);
        data["user"] = Session["su_no"];
        data["name"] = Session["su_login"];
        data["ip"] = Request.UserHostAddress;
        int ret = new sql().ChangePW(data);
        Response.Write(ret);
    }
    /**********************************************/

    /******************招聘企业管理********************/
    /// <summary>
    /// 查询类型Combox
    /// </summary>
    public void CbxComType()
    {
        DataTable dt = new sql().GetLevelByState(1);

        DataRow row = dt.NewRow();
        //row["cl_id"] = "Y1";
        //row["cl_name"] = "过期会员";
        //dt.Rows.InsertAt(row, 0);

        //row = dt.NewRow();
        //row["cl_id"] = "Y0";
        //row["cl_name"] = "有效会员";
        //dt.Rows.InsertAt(row, 0);

        //row = dt.NewRow();
        //row["cl_id"] = "S2";
        //row["cl_name"] = "已审未通过会员";
        //dt.Rows.InsertAt(row, 0);

        //row = dt.NewRow();
        //row["cl_id"] = "S1";
        //row["cl_name"] = "已审通过会员";
        //dt.Rows.InsertAt(row, 0);

        //row = dt.NewRow();
        //row["cl_id"] = "S0";
        //row["cl_name"] = "未审核会员";
        //dt.Rows.InsertAt(row, 0);

        //row = dt.NewRow();
        row["cl_id"] = "0";
        row["cl_name"] = "全部";
        dt.Rows.Add(row);

        string json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 招聘企业列表
    /// </summary>
    public void GetCompanyList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string key = Request["key"];
            string type = Request["type"];
            string level = Request["level"];
            string state = Request["state"];
            string sdate = Request["sdate"];
            string edate = Request["edate"];
            string trade = Request["trade"];
            string property = Request["property"];
            string area = Request["area"];
            string logins = Request["logins"];
            string logine = Request["logine"];

            where = " cu_base is null ";
            if (!string.IsNullOrEmpty(key))
                where += " and (cu_name like '%" + key + "%' or cu_user like '%" + key + "%')";
            if (!string.IsNullOrEmpty(level) && !"0".Equals(level))
                where += " and cu_kind=" + level;
            if (!string.IsNullOrEmpty(type) && !"0".Equals(type))
            {
                if ("1".Equals(type))
                    where += " and cu_state = 1 and DATEADD(DAY,cu_effecttime,cu_apptime)>=GETDATE()";
                else if ("-1".Equals(type))
                    where += " and cu_state = 1 and DATEADD(DAY,cu_effecttime,cu_apptime)<GETDATE()";
                else if ("2".Equals(type))
                    where += " and cu_state = 1 and DATEADD(DAY,cu_effecttime,cu_apptime)>=GETDATE() and DATEADD(DAY,(cu_effecttime-15),cu_apptime)<=GETDATE()";
            }
            if (!string.IsNullOrEmpty(state) && !"-1".Equals(state))
                where += " and cu_state=" + state;
            if (!string.IsNullOrEmpty(sdate))
                where += " and cu_apptime>='" + sdate + "'";
            if (!string.IsNullOrEmpty(edate))
                where += " and cu_apptime<='" + edate + "'";
            if (!string.IsNullOrEmpty(trade) && !"0".Equals(trade))
                where += " and cu_trade='" + trade + "'";
            if (!string.IsNullOrEmpty(property) && !"0".Equals(property))
                where += " and cu_property='" + property + "'";
            if (!string.IsNullOrEmpty(area) && !"0".Equals(area))
                where += " and cu_area='" + area + "'";
            if (!string.IsNullOrEmpty(logins))
                where += " and cu_logintime>='" + logins + "'";
            if (!string.IsNullOrEmpty(logine))
                where += " and cu_logintime<='" + logine + "'";

            DataTable dt = new sql().PagingTable(" companyuser left join companylevel on cu_kind=cl_id ", " *,(select count(re_no) from recruit where re_cuno=cu_no) as re_count,(select count(cm_no) from compayment where cm_cuno=cu_no) as app_count,(select count(cm_no) from compayment where cm_cuno=cu_no and cm_money>0) as pay_count,DATEADD(DAY,cu_effecttime,cu_apptime) as cu_endtime,(select di_name from dictionary where di_code=cu_trade and di_type=1) as trade,(select di_name from dictionary where di_code=cu_property and di_type=2) as property,(select di_name from dictionary where di_code=cu_area and di_type=3) as area", where, sortField, sortOrder, pageSize, pageIndex, " cu_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 企业性质Combox
    /// </summary>
    public void CbxPopertyAll()
    {
        DataTable dt = new sql().GetDictionaryByType(2, 1);
        if (dt != null && dt.Rows.Count > 0)
        {
            DataRow dr = dt.NewRow();
            dr["di_code"] = "0";
            dr["di_name"] = "全部";
            dt.Rows.InsertAt(dr, 0);
        }
        String json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 企业性质Combox
    /// </summary>
    public void CbxPoperty()
    {
        DataTable dt = new sql().GetDictionaryByType(2, 1);
        String json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 所在地区Combox
    /// </summary>
    public void CbxAreaNo()
    {
        DataTable dt = new sql().GetDictionaryByType(3, 1, "999999");
        String json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 所在地区Combox
    /// </summary>
    public void CbxAreaNoAll()
    {
        DataTable dt = new sql().GetDictionaryByType(3, 1, "999999");
        if (dt != null && dt.Rows.Count > 0)
        {
            DataRow dr = dt.NewRow();
            dr["di_code"] = "0";
            dr["di_name"] = "全部";
            dt.Rows.InsertAt(dr, 0);
        }
        String json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 所属行业Combox
    /// </summary>
    public void CbxTrade()
    {
        DataTable dt = new sql().GetDictionaryByType(1, 1);
        String json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 会员等级Combox
    /// </summary>
    public void CbxLevel()
    {
        DataTable dt = new sql().GetLevelByState(1);
        String json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 获取招聘企业
    /// </summary>
    public void GetCompany()
    {
        string id = Request["id"];
        Hashtable data = new sql().GetCompany(id);
        string json = JSON.Encode(data);
        Response.Write(json);
    }

    /// <summary>
    /// 保存招聘企业
    /// </summary>
    public void SaveCompany()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "102");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["user"] = Session["su_no"];
            data["ip"] = Request.UserHostAddress;
            data["name"] = Session["su_login"];

            int ret = new sql().SaveCompany(data);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除招聘企业
    /// </summary>
    public void DeleteCompany()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "102");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteCompany(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 隐藏/显示招聘企业
    /// </summary>
    public void LockCompany()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "102");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().LockCompany(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 批量审核招聘企业
    /// </summary>
    public void CheckCompany()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "102");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().CheckCompany(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 审核招聘企业
    /// </summary>
    public void UpdateCompany()
    {
        bool flg = new sql().CheckPower(Session["su_no"].ToString(), "102");
        if (!flg)
        {
            Response.Write("no");
            return;
        }
        string json = Request["data"];
        Hashtable data = (Hashtable)JSON.Decode(json);
        data["user"] = Session["su_no"];
        data["ip"] = Request.UserHostAddress;
        data["name"] = Session["su_login"];

        int ret = new sql().CheckCompany(data);
        Response.Write(ret);
    }

    /// <summary>
    /// 免审/取消招聘企业
    /// </summary>
    public void OkCompany()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "102");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().OkCompany(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 保存描色
    /// </summary>
    public void SaveCompanyColor()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "102");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string color = Request["color"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().SaveCompanyColor(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), color);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************招聘职位管理********************/
    /// <summary>
    /// 获取招聘企业名称
    /// </summary>
    public void GetCompanyName()
    {
        string id = Request["id"];
        string name = new sql().GetCompanyName(id);
        Response.Write(name);
    }

    /// <summary>
    /// 招聘职位信息列表
    /// </summary>
    public void GetRecruitList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string cuno = Request["cuno"];
            string key = Request["key"];
            string type = Request["type"];

            if (!string.IsNullOrEmpty(cuno))
                where = " re_cuno= " + cuno;
            else
                where = " re_name like '%" + key + "%' ";
            if (!string.IsNullOrEmpty(type) && !"-1".Equals(type))
            {
                if ("0".Equals(type))
                    where += " and re_state=0";
                else if ("1".Equals(type))
                    where += " and re_state=1";
                else if ("2".Equals(type))
                    where += " and re_state=2";
                else if ("3".Equals(type))
                    where += " and re_hide=0";
                else if ("4".Equals(type))
                    where += " and re_hide=1";
                else if ("5".Equals(type))
                    where += " and re_delete=1";
            }
            DataTable dt = new sql().PagingTable(" recruit left join companyuser on cu_no=re_cuno ", " *,DATEADD(DAY,re_effecttime,re_modifytime) as re_endtime ", where, sortField, sortOrder, pageSize, pageIndex, " re_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 企业审核记录
    /// </summary>
    public void GetCompanyAppList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string cu_no = Request["cuno"];

            where = " cm_no>0 ";

            if (!string.IsNullOrEmpty(cu_no))
                where += " and cm_cuno=" + cu_no;
            DataTable dt = new sql().PagingTable(" compayment left join companyuser on cm_cuno=cu_no left join systemuser on cm_insertuser=su_no ", " * ", where, sortField, sortOrder, pageSize, pageIndex, " pp_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }
    /// <summary>
    /// 性别Combox
    /// </summary>
    public void CbxSex()
    {
        DataTable dt = new sql().GetDictionaryByType(5, 1);
        String json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 工作性质Combox
    /// </summary>
    public void CbxKind()
    {
        DataTable dt = new sql().GetDictionaryByType(6, 1);
        String json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 学历Combox
    /// </summary>
    public void CbxEdu()
    {
        DataTable dt = new sql().GetDictionaryByType(4, 1);
        String json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 招聘对象Combox
    /// </summary>
    public void CbxTarget()
    {
        DataTable dt = new sql().GetDictionaryByType(7, 1);
        String json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 父类岗位类别Combox
    /// </summary>
    public void CbxPJobType()
    {
        DataTable dt = new sql().GetJobTypeByStateP(1);
        String json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 子类岗位类别Combox
    /// </summary>
    public void CbxCJobType()
    {
        string id = Request["id"];
        DataTable dt = new sql().GetJobTypeByP(id, 1);
        DataRow dr = dt.NewRow();
        dr["jt_id"] = "0";
        dr["jt_name"] = "全部";
        dt.Rows.InsertAt(dr, 0);
        String json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 工作地区Combox
    /// </summary>
    public void CbxArea()
    {
        DataTable dt = new sql().GetDictionaryByType(3, 1);
        String json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 获取招聘职位
    /// </summary>
    public void GetRecruit()
    {
        string id = Request["id"];
        Hashtable data = new sql().GetRecruit(id);
        string json = JSON.Encode(data);
        Response.Write(json);
    }

    /// <summary>
    /// 保存招聘职位
    /// </summary>
    public void SaveRecruit()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "102,104");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["user"] = Session["su_no"];
            data["ip"] = Request.UserHostAddress;
            data["name"] = Session["su_login"];

            int ret = new sql().SaveRecruit(data);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除招聘职位
    /// </summary>
    public void DeleteRecruit()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "102,104");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteRecruit(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 审核招聘岗位
    /// </summary>
    public void CheckRecruit()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "102,104");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().CheckRecruit(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 隐藏/显示招聘岗位
    /// </summary>
    public void LockRecruit()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "102,104");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().LockRecruit(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 归零招聘岗位点击率
    /// </summary>
    public void ZeroRecruit()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "102,104");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().ZeroRecruit(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 刷新招聘岗位
    /// </summary>
    public void RefreshRecruit()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "102,104");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().RefreshRecruit(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************企业缴费记录管理********************/
    /// <summary>
    /// 企业缴费记录列表
    /// </summary>
    public void GetCompanyPayList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string key = Request["key"];
            string cu_no = Request["cuno"];

            where = " cm_money>0 ";

            if (!string.IsNullOrEmpty(cu_no))
                where += " and cm_cuno=" + cu_no;
            else
            {
                if (!string.IsNullOrEmpty(key))
                    where += " and cu_name like '%" + key + "%'";
            }
            DataTable dt = new sql().PagingTable(" compayment left join companyuser on cm_cuno=cu_no left join systemuser on cm_insertuser=su_no ", " * ", where, sortField, sortOrder, pageSize, pageIndex, " pp_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 保存企业缴费记录
    /// </summary>
    public void SaveCompanyPay()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "102");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["user"] = Session["su_no"];
            data["ip"] = Request.UserHostAddress;
            data["name"] = Session["su_login"];

            int ret = new sql().SaveCompanyPay(data);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除企业缴费记录
    /// </summary>
    public void DeleteCompanyPay()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "102");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteCompanyPay(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************企业照片管理********************/
    /// <summary>
    /// 企业图片列表
    /// </summary>
    public void GetComPictureList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string state = Request["state"];
            string key = Request["key"];

            where = " cu_logo is not null and cu_logo<>'' ";
            if (!string.IsNullOrEmpty(state) && !"-1".Equals(state))
                where += " and cu_logostate=" + state;
            if (!string.IsNullOrEmpty(key))
                where += " and (cu_name like '%" + key + "%' or cu_user like '%" + key + "%')";

            DataTable dt = new sql().PagingTable(" companyuser ", " cu_no,cu_name,cu_logo,cu_logostate ", where, sortField, sortOrder, pageSize, pageIndex, " cu_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 审核企业图片
    /// </summary>
    public void CheckComPicture()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "103");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().CheckComPicture(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除企业图片
    /// </summary>
    public void DeleteComPicture()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "103");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteComPicture(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************紧缺人才审核********************/
    /// <summary>
    /// 紧缺人才列表
    /// </summary>
    public void GetNeedRecruitList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string key = Request["key"];
            string state = Request["state"];

            where = " re_need=1 ";
            if (!string.IsNullOrEmpty(key))
                where += " and (cu_name like '%" + key + "%' or re_name like '%" + key + "%')";
            if (!string.IsNullOrEmpty(state) && !"-1".Equals(state))
                where += " and re_needstate=" + state;

            DataTable dt = new sql().PagingTable(" recruit left join companyuser on cu_no=re_cuno ", " * ,(select jt_name from jobtype where jt_id=re_jobtype1) as job,DATEADD(DAY,cu_effecttime,cu_apptime) as cu_endtime", where, sortField, sortOrder, pageSize, pageIndex, " re_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 审核紧缺岗位
    /// </summary>
    public void CheckTalent()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "105");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().CheckTalent(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除紧缺人才
    /// </summary>
    public void DeleteTalent()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "105");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteTalent(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************会员等级设置********************/
    /// <summary>
    /// 会员等级列表
    /// </summary>
    public void GetLevelList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string state = Request["state"];
            string key = Request["key"];

            where = " cl_name like '%" + key + "%' ";

            if (!string.IsNullOrEmpty(state) && !"-1".Equals(state))
                where += " and cl_state=" + state;

            DataTable dt = new sql().PagingTable(" companylevel ", " * ", where, sortField, sortOrder, pageSize, pageIndex, " cl_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 获取会员等级
    /// </summary>
    public void GetLevel()
    {
        string id = Request["id"];
        Hashtable dt = new sql().GetLevel(id);
        string json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 保存会员等级
    /// </summary>
    public void SaveLevel()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "101");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["user"] = Session["su_no"];
            data["ip"] = Request.UserHostAddress;
            data["name"] = Session["su_login"];

            int ret = new sql().SaveLevel(data);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除会员等级
    /// </summary>
    public void DeleteLevel()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "14");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteLevel(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 隐藏/显示会员等级
    /// </summary>
    public void LockLevel()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "14");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().LockLevel(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************求职人才管理********************/
    /// <summary>
    /// 求职人才列表
    /// </summary>
    public void GetPersonList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string state = Request["state"];
            string type = Request["type"];
            string key = Request["key"];
            string edu = Request["edu"];
            string sdate = Request["sdate"];
            string edate = Request["edate"];
            string yx1 = Request["yx1"];
            string yx2 = Request["yx2"];
            string major1 = Request["major1"];
            string major2 = Request["major2"];

            where = " pi_name is not null and pi_name<>'' ";
            if (!string.IsNullOrEmpty(key))
                where += " and (pi_user like '%" + key + "%' or pi_name like '%" + key + "%')";
            if (!string.IsNullOrEmpty(state) && !"-1".Equals(state))
                where += " and pi_state=" + state;
            if (!string.IsNullOrEmpty(type) && !"-1".Equals(type))
                where += " and pi_hide=" + type;
            if (!string.IsNullOrEmpty(edu) && !"0".Equals(edu))
                where += " and pi_edu='" + edu + "'";
            if (!string.IsNullOrEmpty(sdate))
                where += " and pi_logintime>='" + sdate + "'";
            if (!string.IsNullOrEmpty(edate))
                where += " and pi_logintime<='" + edate + "'";
            if (!string.IsNullOrEmpty(yx1) && !"0".Equals(yx1))
                where += " and (pi_yx1='" + yx1 + "' or pi_yx2='" + yx1 + "')";
            if (!string.IsNullOrEmpty(yx2) && !"0".Equals(yx2))
                where += " and (pi_yx11='" + yx2 + "' or pi_yx22='" + yx2 + "')";
            if (!string.IsNullOrEmpty(major1) && !"0".Equals(major1))
                where += " and ma_id1='" + major1 + "'";
            if (!string.IsNullOrEmpty(major2) && !"0".Equals(major2))
                where += " and pi_spcode='" + major2 + "'";
            DataTable dt = new sql().PagingTable(" personinfor left join findwork on pi_no=fw_pino left join View_major on ma_id2=pi_spcode ", " *,(select ma_name from major where ma_id=pi_spcode) as spcode,(select di_name from dictionary where di_code=pi_edu and di_type=4) as edu,(select jt_name from jobtype where jt_id=pi_yx1) as yx1,(select jt_name from jobtype where jt_id=pi_yx11) as yx11,(select jt_name from jobtype where jt_id=pi_yx2) as yx2,(select jt_name from jobtype where jt_id=pi_yx22) as yx22 ", where, sortField, sortOrder, pageSize, pageIndex, " pi_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 求职人才信息
    /// </summary>
    public void GetPerson()
    {
        string id = Request["id"];
        Hashtable data = new sql().GetPerson(id);
        string json = JSON.Encode(data);
        Response.Write(json);
    }

    /// <summary>
    /// 求职人才信息教育经历
    /// </summary>
    public void GetStudyList()
    {
        string id = Request["id"];
        DataTable data = new sql().GetStudyList(id);
        string json = JSON.Encode(data);
        Response.Write(json);
    }

    /// <summary>
    /// 求职人才信息工作经历
    /// </summary>
    public void GetWorkList()
    {
        string id = Request["id"];
        DataTable data = new sql().GetWorkList(id);
        string json = JSON.Encode(data);
        Response.Write(json);
    }

    /// <summary>
    /// 审核求职人才
    /// </summary>
    public void CheckPerson()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "201");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().CheckPerson(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除求职人才
    /// </summary>
    public void DeletePerson()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "201");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeletePerson(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 隐藏/显示求职人才简历
    /// </summary>
    public void LockPerson()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "201");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().LockPerson(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************个人照片管理********************/
    /// <summary>
    /// 个人照片列表
    /// </summary>
    public void GetPerPictureList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string state = Request["state"];
            string key = Request["key"];

            where = " pi_pic is not null and pi_pic<>'' ";
            if (!string.IsNullOrEmpty(state) && !"-1".Equals(state))
                where += " and pi_picstate=" + state;
            if (!string.IsNullOrEmpty(key))
                where += " and (pi_user like '%" + key + "%' or pi_name like '%" + key + "%')";
            DataTable dt = new sql().PagingTable(" personinfor ", " pi_no,pi_name,pi_pic,pi_picstate ", where, sortField, sortOrder, pageSize, pageIndex, " pi_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 审核个人照片
    /// </summary>
    public void CheckPerPicture()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "202");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().CheckPerPicture(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除个人照片
    /// </summary>
    public void DeletePerPicture()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "202");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeletePerPicture(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************高级人才审核********************/
    /// <summary>
    /// 高级人才列表
    /// </summary>
    public void GetPerHighList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string key = Request["key"];
            string state = Request["state"];

            where = " pi_high=1 ";
            if (!string.IsNullOrEmpty(key))
                where += " (pi_user like '%" + key + "%' or pi_name like '%" + key + "%')";
            if (!string.IsNullOrEmpty(state) && !"-1".Equals(state))
                where += " and pi_highstate=" + state;
            DataTable dt = new sql().PagingTable(" personinfor ", " *,(select ma_name from major where ma_id=pi_spcode) as spcode,(select di_name from dictionary where di_code=pi_edu and di_type=4) as edu ", where, sortField, sortOrder, pageSize, pageIndex, " pi_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 审核高级人才
    /// </summary>
    public void CheckPerHigh()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "203");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().CheckPerHigh(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除高级人才
    /// </summary>
    public void DeletePerHigh()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "203");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeletePerHigh(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************招聘会管理********************/
    /// <summary>
    /// 招聘会列表
    /// </summary>
    public void GetFairList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string key = Request["key"];
            string type = Request["type"];
            string state = Request["state"];

            where = " jf_name like '%" + key + "%' ";
            if (!string.IsNullOrEmpty(type))
                where += " and jf_type=" + type;
            if (!string.IsNullOrEmpty(state) && !"-1".Equals(state))
                where += " and jf_hide=" + state;
            DataTable dt = new sql().PagingTable(" jobfair left join systemuser on su_no=jf_insertuser ", " *,(select count(je_no) from jobenter where je_jfno=jf_no) as jf_count,(select count(1) from uploadfile where uf_nwno=jf_no and uf_type=2) as jf_filecount ", where, sortField, sortOrder, pageSize, pageIndex, " jf_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 获取招聘会
    /// </summary>
    public void GetFair()
    {
        string id = Request["id"];
        Hashtable data = new sql().GetFair(id);
        string json = JSON.Encode(data);
        Response.Write(json);
    }

    /// <summary>
    /// 保存招聘会
    /// </summary>
    public void SaveFair()
    {
        bool flg = new sql().CheckPower(Session["su_no"].ToString(), "401,402");
        if (!flg)
        {
            Response.Write("no");
            return;
        }
        string json = Request["data"];
        Hashtable data = (Hashtable)JSON.Decode(json);
        data["jf_memo"] = Request["content"];
        data["user"] = Session["su_no"];
        data["ip"] = Request.UserHostAddress;
        data["name"] = Session["su_login"];
        data["nw_orderid"] = false;
        Int64 ret = new sql().SaveFair(data);
        Response.Write(ret);
    }

    /// <summary>
    /// 删除招聘会
    /// </summary>
    public void DeleteFair()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "401");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteFair(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 设置报名招聘会
    /// </summary>
    public void EnterFair()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "401");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().EnterFair(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 隐藏/显示招聘会
    /// </summary>
    public void LockFair()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "401");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().LockFair(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 置顶/取消招聘会
    /// </summary>
    public void TopFair()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "401");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().TopFair(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 描红/取消招聘会
    /// </summary>
    public void RedFair()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "401");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().RedFair(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    public void RefreshFair()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "401");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().RefreshFair(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************报名企业管理********************/
    /// <summary>
    /// 获取招聘会名称
    /// </summary>
    public void GetFairName()
    {
        string id = Request["id"];
        string name = new sql().GetFairName(id);
        Response.Write(name);
    }

    /// <summary>
    /// 报名企业列表
    /// </summary>
    public void GetFairEntryList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string jfno = Request["jfno"];
            string state = Request["state"];

            where = " fe_jfno=" + jfno;
            if (!string.IsNullOrEmpty(state) && !"-1".Equals(state))
                where += " and fe_state=" + state;
            DataTable dt = new sql().PagingTable(" fairentry left join companyuser on cu_no=fe_cuno", " *,(select count(je_no) from jobenter where je_feno=fe_no and je_cuno=fe_cuno) as fe_count ", where, sortField, sortOrder, pageSize, pageIndex, " fe_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 审核报名企业
    /// </summary>
    public void CheckFairEntry()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "401");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().CheckFairEntry(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除报名企业
    /// </summary>
    public void DeleteFairEntry()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "22");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteFairEntry(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************报名职位管理********************/
    /// <summary>
    /// 报名职位列表
    /// </summary>
    public void GetJobEnterList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string jfno = Request["jfno"];
            string key = Request["key"];
            string state = Request["state"];

            where = " je_jfno=" + jfno;
            if (!string.IsNullOrEmpty(key))
                where += " and je_name like '%" + key + "%'";
            if (!string.IsNullOrEmpty(state) && !"-1".Equals(state))
                where += " and je_state=" + state;
            DataTable dt = new sql().PagingTable(" jobenter ", " * ", where, sortField, sortOrder, pageSize, pageIndex, " je_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 审核报名职位
    /// </summary>
    public void CheckJobEnter()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "22");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().CheckJobEnter(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除报名职位
    /// </summary>
    public void DeleteJobEnter()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "22");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteJobEnter(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************新闻资讯管理********************/
    /// <summary>
    /// 新闻资讯列表
    /// </summary>
    public void GetNewsList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string key = Request["key"];
            string type = Request["type"];
            string state = Request["state"];

            where = " nw_no>0 ";
            if (!string.IsNullOrEmpty(key))
                where += " and nw_title like '%" + key + "%'";
            if (!string.IsNullOrEmpty(type) && !"-1".Equals(type))
                where += " and nw_type=" + type;
            if (!string.IsNullOrEmpty(state) && !"-1".Equals(state))
                where += " and nw_hide=" + state;

            DataTable dt = new sql().PagingTable(" news left join systemuser on nw_insertuser=su_no ", " *,(select count(1) from uploadfile where uf_nwno=nw_no and uf_type=1) as nw_count,(select su_login from systemuser where su_no=nw_modifyuser) as modifylogin ", where, sortField, sortOrder, pageSize, pageIndex, " nw_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 获取新闻资讯
    /// </summary>
    public void GetNews()
    {
        string id = Request["id"];
        Hashtable data = new sql().GetNews(id);
        string json = JSON.Encode(data);
        Response.Write(json);
    }

    /// <summary>
    /// 保存新闻资讯
    /// </summary>
    public void SaveNews()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "107,108,204,205,301,302,303,304,305,306,307,308,310,311,501,502,601,602,701,702,801,802,901,902,1101,1102,1201,1202,1203,1204");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["nw_content"] = Request["content"];
            data["user"] = Session["su_no"];
            data["ip"] = Request.UserHostAddress;
            data["name"] = Session["su_login"];
            data["nw_orderid"] = false;

            int ret = new sql().SaveNews(data);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除新闻资讯
    /// </summary>
    public void DeleteNews()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "107,108,204,205,301,302,303,304,305,306,307,308,310,311,501,502,601,602,701,702,801,802,901,902,1101,1102,1201,1202,1203,1204");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteNews(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 隐藏/显示新闻资讯
    /// </summary>
    public void LockNews()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "107,108,204,205,301,302,303,304,305,306,307,308,310,311,501,502,601,602,701,702,801,802,901,902,1101,1102,1201,1202,1203,1204");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().LockNews(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 置顶/取消新闻资讯
    /// </summary>
    public void TopNews()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "107,108,204,205,301,302,303,304,305,306,307,308,310,311,501,502,601,602,701,702,801,802,901,902,1101,1102,1201,1202,1203,1204");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().TopNews(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 描红/取消新闻资讯
    /// </summary>
    public void RedNews()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "107,108,204,205,301,302,303,304,305,306,307,308,310,311,501,502,601,602,701,702,801,802,901,902,1101,1102,1201,1202,1203,1204");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().RedNews(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 设置/取消最新新闻资讯
    /// </summary>
    public void NewNews()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "107,108,204,205,301,302,303,304,305,306,307,308,310,311,501,502,601,602,701,702,801,802,901,902,1101,1102,1201,1202,1203,1204");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().NewNews(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 刷新新闻资讯
    /// </summary>
    public void RefreshNews()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "107,108,204,205,301,302,303,304,305,306,307,308,310,311,501,502,601,602,701,702,801,802,901,902,1101,1102,1201,1202,1203,1204");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().RefreshNews(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 上传文件管理（新闻）
    /// </summary>
    public void GetFilesList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string nwno = Request["nwno"];
            string key = Request["key"];
            string type = Request["type"];

            where = " uf_type=1 ";
            if (!string.IsNullOrEmpty(key))
                where += " and nw_title like '%" + key + "%'";
            if (!string.IsNullOrEmpty(type) && !"-1".Equals(type))
                where += " and nw_type=" + type;
            if (!string.IsNullOrEmpty(nwno))
                where += " and uf_nwno=" + nwno;

            DataTable dt = new sql().PagingTable(" uploadfile left join news on uf_nwno=nw_no ", " uf_no,uf_type,uf_nwno,uf_url,uf_time,nw_no,nw_title,nw_type,getdate() as uf_servertime ", where, sortField, sortOrder, pageSize, pageIndex, " uf_no ", out Count);
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string savePath = dt.Rows[i]["uf_url"].ToString();
                if (!string.IsNullOrEmpty(savePath))
                {
                    string dirPath = Server.MapPath(savePath);
                    FileInfo f = new FileInfo(dirPath);
                    dt.Rows[i]["uf_servertime"] = f.LastWriteTime;
                }
                else
                    dt.Rows[i]["uf_servertime"] = DBNull.Value;
            }
            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 上传文件管理（招聘会）
    /// </summary>
    public void GetFilesFairList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string jfno = Request["jfno"];
            string key = Request["key"];

            where = " uf_type=2 ";
            if (!string.IsNullOrEmpty(key))
                where += " and jf_name like '%" + key + "%'";
            if (!string.IsNullOrEmpty(jfno))
                where += " and uf_nwno=" + jfno;

            DataTable dt = new sql().PagingTable(" uploadfile left join jobfair on uf_nwno=jf_no ", " uf_url,uf_time,jf_name,getdate() as uf_servertime ", where, sortField, sortOrder, pageSize, pageIndex, " uf_no ", out Count);
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string savePath = dt.Rows[i]["uf_url"].ToString();
                if (!string.IsNullOrEmpty(savePath))
                {
                    string dirPath = Server.MapPath(savePath);
                    FileInfo f = new FileInfo(dirPath);
                    dt.Rows[i]["uf_servertime"] = f.LastWriteTime;
                }
                else
                    dt.Rows[i]["uf_servertime"] = DBNull.Value;
            }
            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }
    /**********************************************/

    /******************通知公告文件公布管理********************/
    /// <summary>
    /// 通知公告文件公布列表
    /// </summary>
    public void GetFileList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string key = Request["key"];
            string type = Request["type"];

            where = " nw_no>0 ";
            if (!string.IsNullOrEmpty(key))
                where += " and nw_title like '%" + key + "%'";
            if (!string.IsNullOrEmpty(type) && !"-1".Equals(type))
                where += " and nw_type=" + type;

            DataTable dt = new sql().PagingTable(" news ", " *,getdate() as nw_servertime ", where, sortField, sortOrder, pageSize, pageIndex, " nw_no ", out Count);
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string savePath = dt.Rows[i]["nw_img"].ToString();
                if (!string.IsNullOrEmpty(savePath))
                {
                    string dirPath = Server.MapPath(savePath);
                    FileInfo f = new FileInfo(dirPath);
                    dt.Rows[i]["nw_servertime"] = f.LastWriteTime;
                }
                else
                    dt.Rows[i]["nw_servertime"] = DBNull.Value;
            }
            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 保存通知公告文件公布
    /// </summary>
    public void SaveFile()
    {
        try
        {
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["nw_content"] = Request["content"];
            data["nw_uploadtime"] = Request["uploadtime"];
            data["user"] = Session["su_no"];
            data["ip"] = Request.UserHostAddress;
            data["name"] = Session["su_login"];

            //int ret = new sql().SaveFile(data);
            //Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************党员缴费记录管理********************/
    /// <summary>
    /// 党员缴费记录列表
    /// </summary>
    public void GetPartyPayList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string key = Request["key"];

            where = " pp_no>0 ";
            if (!string.IsNullOrEmpty(key))
                where += " and pp_name like '%" + key + "%'";
            DataTable dt = new sql().PagingTable(" partypayment ", " * ", where, sortField, sortOrder, pageSize, pageIndex, " pp_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 保存党员缴费记录
    /// </summary>
    public void SavePartyPay()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "903");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["user"] = Session["su_no"];
            data["ip"] = Request.UserHostAddress;
            data["name"] = Session["su_login"];

            int ret = new sql().SavePartyPay(data);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除党员缴费记录
    /// </summary>
    public void DeletePartyPay()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "903");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeletePartyPay(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************HR协会会员管理********************/
    /// <summary>
    /// HR协会会员列表
    /// </summary>
    public void GetMemberList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string key = Request["key"];
            string state = Request["state"];

            where = " hr_no>0 ";
            if (!string.IsNullOrEmpty(key))
                where += " and (hr_company like '%" + key + "%' or hr_card like '%" + key + "%')";
            if (!string.IsNullOrEmpty(state) && !"-1".Equals(state))
                where += " and hr_hide=" + state;
            DataTable dt = new sql().PagingTable(" hrmember ", " *,(select count(hp_no) from hrpayment where hp_hrno=hr_no) as hr_count ", where, sortField, sortOrder, pageSize, pageIndex, " hr_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 性别Combox
    /// </summary>
    public void GetCbxSex()
    {
        DataTable dt = new sql().GetDictionaryByType(5, 1, "9");
        string json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 学历Combox
    /// </summary>
    public void GetCbxEdu()
    {
        DataTable dt = new sql().GetDictionaryByType(4, 1, "99");
        string json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 获取HR协会会员
    /// </summary>
    public void GetMember()
    {
        string id = Request["id"];
        Hashtable data = new sql().GetMember(id);
        string json = JSON.Encode(data);
        Response.Write(json);
    }

    /// <summary>
    /// 保存HR协会会员
    /// </summary>
    public void SaveMember()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1003");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["user"] = Session["su_no"];
            data["ip"] = Request.UserHostAddress;
            data["name"] = Session["su_login"];

            int ret = new sql().SaveMember(data);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除HR协会会员
    /// </summary>
    public void DeleteMember()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1003");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteMember(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 隐藏/显示HR协会会员
    /// </summary>
    public void LockMember()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1003");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().LockMember(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************HR协会会员缴费记录管理********************/
    /// <summary>
    /// 获取HR协会会员名称
    /// </summary>
    public void GetHrName()
    {
        string id = Request["id"];
        string name = new sql().GetHrName(id);
        Response.Write(name);
    }
    /// <summary>
    /// HR协会会员缴费记录列表
    /// </summary>
    public void GetHrPayList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string key = Request["key"];

            where = " hp_no>0 ";
            if (!string.IsNullOrEmpty(key))
                where += " and (hr_company like '%" + key + "%' or hr_card like '%" + key + "%')";
            DataTable dt = new sql().PagingTable(" hrpayment left join hrmember on hp_hrno=hr_no ", " * ", where, sortField, sortOrder, pageSize, pageIndex, " hp_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 保存HR协会会员缴费记录
    /// </summary>
    public void SaveHrPay()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1003");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["user"] = Session["su_no"];
            data["ip"] = Request.UserHostAddress;
            data["name"] = Session["su_login"];

            int ret = new sql().SaveHrPay(data);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除HR协会会员缴费记录
    /// </summary>
    public void DeleteHrPay()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1003");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteHrPay(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************咨询管理********************/
    /// <summary>
    /// 咨询列表
    /// </summary>
    public void GetConsultList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            string where = "";
            string type = Request["type"];

            if (!string.IsNullOrEmpty(type) && !"0".Equals(type))
                where = " cs_asktype=" + type;
            DataTable dt = new sql().PagingTable(" consult ", " * ", where, sortField, sortOrder, pageSize, pageIndex, " pi_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 获取咨询
    /// </summary>
    public void GetConsult()
    {
        string id = Request["id"];
        Hashtable data = new sql().GetConsult(id);
        string json = JSON.Encode(data);
        Response.Write(json);
    }

    /// <summary>
    /// 回复咨询
    /// </summary>
    public void SaveConsult()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "109,504,603,706,904,49,50");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["user"] = Session["su_no"];
            data["ip"] = Request.UserHostAddress;
            data["name"] = Session["su_login"];

            int ret = new sql().SaveConsult(data);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除咨询
    /// </summary>
    public void DeleteConsult()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "109,45,46,47,48,49,50");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteConsult(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/


    /******************角色权限设置********************/
    /// <summary>
    /// 角色列表
    /// </summary>
    public void GetActorList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string state = Request["state"];
            string key = Request["key"];

            where = " ac_no>0 ";
            if (!string.IsNullOrEmpty(state) && !"-1".Equals(state))
            {
                where += " and ac_state=" + state;
            }
            if (!string.IsNullOrEmpty(key))
            {
                where += " and ac_name like '%" + key + "%'";
            }
            DataTable dt = new sql().PagingTable(" actor ", " * ", where, sortField, sortOrder, pageSize, pageIndex, " ac_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 角色Combox
    /// </summary>
    public void GetCbxActor()
    {
        DataTable dt = new sql().GetActorByState(1);
        string json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 获取角色
    /// </summary>
    public void GetActor()
    {
        string id = Request["id"];
        Hashtable actor = new sql().GetActor(id);
        string json = JSON.Encode(actor);
        Response.Write(json);
    }

    /// <summary>
    /// 保存角色
    /// </summary>
    public void SaveActor()
    {
        bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1501");
        if (!flg)
        {
            Response.Write("no");
            return;
        }
        string json = Request["data"];
        Hashtable data = (Hashtable)JSON.Decode(json);
        data["user"] = Session["su_no"];
        data["ip"] = Request.UserHostAddress;
        data["name"] = Session["su_login"];
        int ret = new sql().SaveActor(data);
        Response.Write(ret);
    }

    /// <summary>
    /// 删除角色
    /// </summary>
    public void DeleteActor()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1501");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteActor(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************管理员账户管理********************/
    /// <summary>
    /// 管理员账户列表
    /// </summary>
    public void GetUserList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string state = Request["state"];
            string key = Request["key"];

            where = " su_no>0 ";
            if (!string.IsNullOrEmpty(state) && !"-1".Equals(state))
            {
                where += " and su_state=" + state;
            }
            if (!string.IsNullOrEmpty(key))
            {
                where += " and (su_name like '%" + key + "%' or su_realname like '%" + key + "%')";
            }
            DataTable dt = new sql().PagingTable(" systemuser left join actor on su_power=ac_no ", " * ", where, sortField, sortOrder, pageSize, pageIndex, " su_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 获取管理员账户
    /// </summary>
    public void GetUser()
    {
        string id = Request["id"];
        Hashtable user = new sql().GetUser(id);
        string json = JSON.Encode(user);
        Response.Write(json);
    }

    /// <summary>
    /// 保存管理员账户
    /// </summary>
    public void SaveUser()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1502");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["user"] = Session["su_no"];
            data["ip"] = Request.UserHostAddress;
            data["name"] = Session["su_login"];

            int ret = new sql().SaveUser(data);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除管理员账户
    /// </summary>
    public void DeleteUser()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1502");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteUser(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 隐藏/显示管理员账户
    /// </summary>
    public void LockUser()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1502");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().LockUser(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************岗位类别设置********************/
    /// <summary>
    /// 岗位类别列表
    /// </summary>
    public void GetJobTypeList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string state = Request["state"];
            string key = Request["key"];

            where = " jt_no>0 ";
            if (!string.IsNullOrEmpty(state) && !"-1".Equals(state))
            {
                where += " and jt_state=" + state;
            }
            if (!string.IsNullOrEmpty(key))
            {
                where += " and (jt_name like '%" + key + "%')";
            }
            DataTable dt = new sql().PagingTable(" jobtype ", " * ", where, sortField, sortOrder, pageSize, pageIndex, " jt_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 获取岗位类别
    /// </summary>
    public void GetJobType()
    {
        string id = Request["id"];
        Hashtable data = new sql().GetJobType(id);
        string json = JSON.Encode(data);
        Response.Write(json);
    }

    /// <summary>
    /// 父类岗位类别Combox
    /// </summary>
    public void GetCbxJobTypeP()
    {
        DataTable dt = new sql().GetJobTypeByStateP(1);
        DataRow dr = dt.NewRow();
        dr["jt_id"] = "0";
        dr["jt_name"] = "无";
        dt.Rows.InsertAt(dr, 0);
        string json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 保存岗位类别
    /// </summary>
    public void SaveJobType()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1504");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["user"] = Session["su_no"];
            data["ip"] = Request.UserHostAddress;
            data["name"] = Session["su_login"];

            int ret = new sql().SaveJobType(data);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除岗位类别
    /// </summary>
    public void DeleteJobType()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1504");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteJobType(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 隐藏/显示岗位类别
    /// </summary>
    public void LockJobType()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1504");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().LockJobType(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************专业类别设置********************/
    /// <summary>
    /// 专业类别列表
    /// </summary>
    public void GetMajorTypeList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string state = Request["state"];
            string key = Request["key"];

            where = " ma_no>0 ";
            if (!string.IsNullOrEmpty(state) && !"-1".Equals(state))
            {
                where += " and ma_state=" + state;
            }
            if (!string.IsNullOrEmpty(key))
            {
                where += " and (ma_name like '%" + key + "%')";
            }
            DataTable dt = new sql().PagingTable(" major ", " * ", where, sortField, sortOrder, pageSize, pageIndex, " ma_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 获取专业类别
    /// </summary>
    public void GetMajorType()
    {
        string id = Request["id"];
        Hashtable data = new sql().GetMajorType(id);
        string json = JSON.Encode(data);
        Response.Write(json);
    }

    /// <summary>
    /// 父类专业类别Combox
    /// </summary>
    public void GetCbxMajorTypeP()
    {
        DataTable dt = new sql().GetMajorTypeByStateP(1);
        DataRow dr = dt.NewRow();
        dr["ma_id"] = "0";
        dr["ma_name"] = "无";
        dt.Rows.InsertAt(dr, 0);
        string json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 保存专业类别
    /// </summary>
    public void SaveMajorType()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1505");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["user"] = Session["su_no"];
            data["ip"] = Request.UserHostAddress;
            data["name"] = Session["su_login"];

            int ret = new sql().SaveMajorType(data);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除专业类别
    /// </summary>
    public void DeleteMajorType()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1505");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteMajorType(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 隐藏/显示专业类别
    /// </summary>
    public void LockMajorType()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1505");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().LockMajorType(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************系统字典管理********************/
    /// <summary>
    /// 系统字典列表
    /// </summary>
    public void GetDictionaryList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string type = Request["type"];
            string state = Request["state"];
            string key = Request["key"];

            where = " di_no>0 ";
            if (!string.IsNullOrEmpty(type) && !"-1".Equals(type))
            {
                where += " and di_type=" + type;
            }
            if (!string.IsNullOrEmpty(state) && !"-1".Equals(state))
            {
                where += " and di_state=" + state;
            }
            if (!string.IsNullOrEmpty(key))
            {
                where += " and (di_name like '%" + key + "%')";
            }
            DataTable dt = new sql().PagingTable(" dictionary ", " * ", where, sortField, sortOrder, pageSize, pageIndex, " di_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 获取系统字典
    /// </summary>
    public void GetDictionary()
    {
        string id = Request["id"];
        Hashtable data = new sql().GetDictionary(id);
        string json = JSON.Encode(data);
        Response.Write(json);
    }

    /// <summary>
    /// 保存系统字典
    /// </summary>
    public void SaveDictionary()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1503");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["user"] = Session["su_no"];
            data["ip"] = Request.UserHostAddress;
            data["name"] = Session["su_login"];

            int ret = new sql().SaveDictionary(data);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除系统字典
    /// </summary>
    public void DeleteDictionary()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1503");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteDictionary(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 隐藏/显示系统字典
    /// </summary>
    public void LockDictionary()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1503");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().LockDictionary(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************网站基本设置********************/
    /// <summary>
    /// 获取网站基本信息
    /// </summary>
    public void GetWebset()
    {
        Hashtable webset = new sql().GetWebset();
        string json = JSON.Encode(webset);
        Response.Write(json);
    }

    /// <summary>
    /// 保存网站基本信息
    /// </summary>
    public void SaveWebset()
    {
        try
        {
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["user"] = Session["su_no"];
            data["name"] = Session["su_login"];
            data["ip"] = Request.UserHostAddress;

            int ret = new sql().SaveWebset(data);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************系统日志查看********************/
    /// <summary>
    /// 系统日志列表
    /// </summary>
    public void GetSyslogList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string state = Request["state"];
            string key = Request["key"];
            string suno = Request["suno"];

            where = " sl_no>0 ";
            if (!string.IsNullOrEmpty(suno))
                where += " and sl_man=" + suno;
            if (!string.IsNullOrEmpty(state) && !"-1".Equals(state))
                where += " and sl_type=" + state;
            if (!string.IsNullOrEmpty(key))
                where += " and (sl_memo like '%" + key + "%')";
            DataTable dt = new sql().PagingTable(" syslog left join systemuser on su_no=sl_man ", " * ", where, sortField, sortOrder, pageSize, pageIndex, " sl_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 获取用户名
    /// </summary>
    public void GetUserName()
    {
        string id = Request["id"];
        string name = new sql().GetUserName(id);
        Response.Write(name);
    }
    /**********************************************/

    /******************友情链接管理********************/
    /// <summary>
    /// 友情链接列表
    /// </summary>
    public void GetLinkList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string key = Request["key"];
            string type = Request["type"];
            string state = Request["state"];

            where = " fl_no>0 ";
            if (!string.IsNullOrEmpty(key))
                where += " and fl_title like '%" + key + "%'";
            if (!string.IsNullOrEmpty(type))
                where += " and fl_type=" + type;
            if (!string.IsNullOrEmpty(state) && !"-1".Equals(state))
                where += " and fl_hide=" + state;
            DataTable dt = new sql().PagingTable(" friendlink ", " * ", where, sortField, sortOrder, pageSize, pageIndex, " fl_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 获取友情链接
    /// </summary>
    public void GetLink()
    {
        string id = Request["id"];
        Hashtable data = new sql().GetLink(id);
        string json = JSON.Encode(data);
        Response.Write(json);
    }

    /// <summary>
    /// 保存友情链接
    /// </summary>
    public void SaveLink()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "905,1005,1103,1506");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["user"] = Session["su_no"];
            data["ip"] = Request.UserHostAddress;
            data["name"] = Session["su_login"];

            int ret = new sql().SaveLink(data);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除友情链接
    /// </summary>
    public void DeleteLink()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "905,1005,1103,1506");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteLink(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 隐藏/显示友情链接
    /// </summary>
    public void LockLink()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "905,1005,1103,1506");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().LockLink(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 置顶/取消友情链接
    /// </summary>
    public void TopLink()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "905,1005,1103,1506");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string order = Request["order"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().TopLink(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id, order);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 获取单位列表
    /// </summary>
    public void GetComList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string key = Request["key"];

            where = " cu_no>0 ";
            if (!string.IsNullOrEmpty(key))
            {
                where += " and cu_name like '%" + key + "%'";
            }
            DataTable dt = new sql().PagingTable(" companyuser ", " * ", where, sortField, sortOrder, pageSize, pageIndex, " cu_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }
    /**********************************************/

    /******************广告管理********************/
    /// <summary>
    /// 广告列表
    /// </summary>
    public void GetAdList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string key = Request["key"];
            string type = Request["type"];

            where = " ad_no>0 ";
            if (!string.IsNullOrEmpty(key))
                where += " and ad_title like '%" + key + "%'";
            if (!string.IsNullOrEmpty(type) && !"-1".Equals(type))
            {
                if ("10".Equals(type))
                    where += " and ad_hide=0";
                else if ("11".Equals(type))
                    where += " and ad_hide=1";
                else if ("12".Equals(type))
                    where += " and DATEADD(DAY,ad_effecttime,ad_inserttime)<getdate()";
                else
                    where += " and ad_type=" + type;
            }

            DataTable dt = new sql().PagingTable(" advertisement ", " *,DATEADD(DAY,ad_effecttime,ad_inserttime) as ad_endtime ", where, sortField, sortOrder, pageSize, pageIndex, " ad_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 获取广告
    /// </summary>
    public void GetAd()
    {
        string id = Request["id"];
        Hashtable data = new sql().GetAd(id);
        string json = JSON.Encode(data);
        Response.Write(json);
    }

    /// <summary>
    /// 保存广告
    /// </summary>
    public void SaveAd()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1004,1507");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["user"] = Session["su_no"];
            data["ip"] = Request.UserHostAddress;
            data["name"] = Session["su_login"];

            int ret = new sql().SaveAd(data);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除广告
    /// </summary>
    public void DeleteAd()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1004,1507");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteAd(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 显示/隐藏广告
    /// </summary>
    public void LockAd()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1004,1507");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().LockAd(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 置顶/取消广告
    /// </summary>
    public void TopAd()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1004,1507");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string order = Request["order"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().TopAd(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id, order);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 设置/取消广告
    /// </summary>
    public void NewAd()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1004,1507");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().NewAd(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 设置/取消广告
    /// </summary>
    public void SelectAd()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1004,1507");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().SelectAd(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************未就业毕业生审核********************/
    /// <summary>
    /// 未就业毕业生列表
    /// </summary>
    public void GetStudentList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string key = Request["key"];
            string state = Request["state"];

            where = " st_no>0 ";
            if (!string.IsNullOrEmpty(key))
                where += " and st_name like '%" + key + "%'";
            if (!string.IsNullOrEmpty(state) && !"-1".Equals(state))
                where += " and st_state=" + state;

            DataTable dt = new sql().PagingTable(" student ", " * ", where, sortField, sortOrder, pageSize, pageIndex, " st_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 获取未就业毕业生
    /// </summary>
    public void GetStudent()
    {
        string id = Request["id"];
        Hashtable data = new sql().GetStudent(id);
        string json = JSON.Encode(data);
        Response.Write(json);
    }

    /// <summary>
    /// 保存未就业毕业生
    /// </summary>
    public void SaveStudent()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "703");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["user"] = Session["su_no"];
            data["ip"] = Request.UserHostAddress;
            data["name"] = Session["su_login"];

            int ret = new sql().SaveStudent(data);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除未就业毕业生
    /// </summary>
    public void DeleteStudent()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "703");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteStudent(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 审核未就业毕业生
    /// </summary>
    public void CheckStudent()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "703");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().CheckStudent(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************职位信息统计********************/
    /// <summary>
    /// 父类岗位类别Combox
    /// </summary>
    public void CbxJobTypeP()
    {
        DataTable dt = new sql().GetJobTypeByStateP(1);
        DataRow dr = dt.NewRow();
        dr["jt_id"] = "0";
        dr["jt_name"] = "全部";
        dt.Rows.InsertAt(dr, 0);
        string json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 根据父类岗位取子类岗位
    /// </summary>
    public void CbxJobTypeByP()
    {
        string id = Request["id"];
        DataTable dt = new sql().GetJobTypeByP(id, 1);
        if (dt != null && dt.Rows.Count > 0)
        {
            DataRow dr = dt.NewRow();
            dr["jt_id"] = "0";
            dr["jt_name"] = "全部";
            dt.Rows.InsertAt(dr, 0);
        }
        string json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 职位信息统计（按职位类型）
    /// </summary>
    public void SJobByType()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = " re_state=1 ";
            string table = "";
            string type = Request["type"];
            string sdate = Request["sdate"];
            string edate = Request["edate"];

            if (!string.IsNullOrEmpty(type) && !"0".Equals(type))
            {
                where += " and re_jobtype1='" + type + "'";
                table = " recruit inner join jobtype on jt_id=re_jobtype11 ";
            }
            else
            {
                //where += " and jt_pid='0'";
                table = " recruit inner join jobtype on jt_id=re_jobtype1 ";
            }
            if (!string.IsNullOrEmpty(sdate))
                where += " and re_inserttime>='" + sdate + "'";
            if (!string.IsNullOrEmpty(edate))
                where += " and re_inserttime<='" + edate + "'";
            string groupby = " jt_id,jt_name ";
            DataTable dt = new sql().PagingTable(table, " jt_id,jt_name,count(re_no) as re_count,(cast((cast(count(re_no) as float)*100/(select case when count(re_no)=0 then 1 else count(re_no) end from " + table + " where " + where + ")) as numeric(5,2))) as re_percent ", where, groupby, sortField, sortOrder, pageSize, pageIndex, " re_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            DataTable dt1 = new sql().GetSJobCount(table, where);
            if (dt1 != null && dt1.Rows.Count > 0)
                result["jobcount"] = dt1.Rows[0]["jobcount"].ToString();
            else
                result["jobcount"] = 0;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 职位信息统计（学历）
    /// </summary>
    public void SJobByEdu()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = " re_state=1 ";
            string sdate = Request["sdate"];
            string edate = Request["edate"];

            if (!string.IsNullOrEmpty(sdate))
                where += " and re_inserttime>='" + sdate + "'";
            if (!string.IsNullOrEmpty(edate))
                where += " and re_inserttime<='" + edate + "'";
            string groupby = " di_code,di_name ";
            DataTable dt = new sql().PagingTable(" recruit inner join dictionary on di_code=re_edu and di_type=4 ", " di_code,di_name,count(re_no) as re_count,(cast((cast(count(re_no) as float)*100/(select case when count(re_no)=0 then 1 else count(re_no) end from recruit inner join dictionary on di_code=re_edu and di_type=4 where " + where + ")) as numeric(5,2))) as re_percent ", where, groupby, sortField, sortOrder, pageSize, pageIndex, " re_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            DataTable dt1 = new sql().GetSJobCount(" recruit inner join dictionary on di_code=re_edu and di_type=4 ", where);
            if (dt1 != null && dt1.Rows.Count > 0)
                result["jobcount"] = dt1.Rows[0]["jobcount"].ToString();
            else
                result["jobcount"] = 0;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 职位信息统计
    /// </summary>
    public void SJob()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = " re_need<>1 and re_state=1 ";
            string type1 = Request["type1"];
            string type2 = Request["type2"];
            string sdate = Request["sdate"];
            string edate = Request["edate"];

            if (!string.IsNullOrEmpty(type1) && !"0".Equals(type1))
                where += " and (re_jobtype1=" + type1 + " or re_jobtype2=" + type1 + ")";
            if (!string.IsNullOrEmpty(type2) && !"0".Equals(type2))
                where += " and (re_jobtype11=" + type2 + " or re_jobtype22=" + type2 + ")";
            if (!string.IsNullOrEmpty(sdate))
                where += " and re_inserttime>='" + sdate + "'";
            if (!string.IsNullOrEmpty(edate))
                where += " and re_inserttime<='" + edate + "'";

            DataTable dt = new sql().PagingTable(" recruit left join companyuser on re_cuno=cu_no ", " *,(select di_name from dictionary where di_type=3 and di_code=re_area) as area,(select di_name from dictionary where di_type=5 and di_code=re_sex) as sex,(select di_name from dictionary where di_type=6 and di_code=re_kind) as kind,(select di_name from dictionary where di_type=4 and di_code=re_edu) as edu,(select di_name from dictionary where di_type=7 and di_code=re_target) as target,(select jt_name from jobtype where jt_id=re_jobtype1) as jobtype1,(select jt_name from jobtype where jt_id=re_jobtype11) as jobtype11,(select jt_name from jobtype where jt_id=re_jobtype2) as jobtype2,(select jt_name from jobtype where jt_id=re_jobtype22) as jobtype22 ", where, sortField, sortOrder, pageSize, pageIndex, " re_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************人才信息统计********************/
    /// <summary>
    /// 父类专业类别Combox
    /// </summary>
    public void CbxMajorP()
    {
        string id = Request["id"];
        DataTable dt = new sql().GetMajorTypeByStateP(1);
        if (dt != null && dt.Rows.Count > 0)
        {
            DataRow dr = dt.NewRow();
            dr["ma_id"] = "0";
            dr["ma_name"] = "全部";
            dt.Rows.InsertAt(dr, 0);
        }
        string json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 根据父类专业取子类专业
    /// </summary>
    public void CbxMajorByP()
    {
        string id = Request["id"];
        DataTable dt = new sql().GetMajorTypeByP(id, 1);
        if (dt != null && dt.Rows.Count > 0)
        {
            DataRow dr = dt.NewRow();
            dr["ma_id"] = "0";
            dr["ma_name"] = "全部";
            dt.Rows.InsertAt(dr, 0);
        }
        string json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 学历Combox
    /// </summary>
    public void CbxEduNoAll()
    {
        DataTable dt = new sql().GetDictionaryByType(4, 1, "99");
        if (dt != null && dt.Rows.Count > 0)
        {
            DataRow dr = dt.NewRow();
            dr["di_code"] = "0";
            dr["di_name"] = "全部";
            dt.Rows.InsertAt(dr, 0);
        }
        string json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 人才信息统计
    /// </summary>
    public void SPerson()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = " pi_high<>1 and pi_state=1 ";
            string type1 = Request["type1"];
            string type2 = Request["type2"];
            string sdate = Request["sdate"];
            string edate = Request["edate"];

            if (!string.IsNullOrEmpty(type1) && !"0".Equals(type1))
                where += " and (pi_yx1=" + type1 + " or pi_yx2=" + type1 + ")";
            if (!string.IsNullOrEmpty(type2) && !"0".Equals(type2))
                where += " and (pi_yx11=" + type2 + " or pi_yx22=" + type2 + ")";
            if (!string.IsNullOrEmpty(sdate))
                where += " and pi_lastchgtime>='" + sdate + "'";
            if (!string.IsNullOrEmpty(edate))
                where += " and pi_lastchgtime<='" + edate + "'";

            DataTable dt = new sql().PagingTable(" personinfor ", " *,(select di_name from dictionary where di_type=3 and di_code=pi_workarea) as area,(select di_name from dictionary where di_type=5 and di_code=pi_sex) as sex,(select ma_name from major where ma_id=pi_spcode) as spcode,(select di_name from dictionary where di_type=4 and di_code=pi_edu) as edu,(select di_name from dictionary where di_type=6 and di_code=pi_jobtype) as kind,(select jt_name from jobtype where jt_id=pi_yx1) as yx1,(select jt_name from jobtype where jt_id=pi_yx11) as jobtype11,(select jt_name from jobtype where jt_id=pi_yx2) as yx2,(select jt_name from jobtype where jt_id=pi_yx22) as yx22 ", where, sortField, sortOrder, pageSize, pageIndex, " pi_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 人才信息统计（按专业类型）
    /// </summary>
    public void SPersonByMajor()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = " pi_state=1 ";
            string select = "";
            string groupby = "";
            string type = Request["type"];
            string sdate = Request["sdate"];
            string edate = Request["edate"];

            if (!string.IsNullOrEmpty(type) && !"0".Equals(type))
            {
                where += " and ma_id1='" + type + "'";
                select = " ma_id2 as ma_id,ma_name2 as ma_name,count(pi_no) as pi_count ";
                groupby = "ma_id2,ma_name2";
            }
            else
            {
                select = " ma_id1 as ma_id,ma_name1 as ma_name,count(pi_no) as pi_count ";
                groupby = "ma_id1,ma_name1";
            }
            if (!string.IsNullOrEmpty(sdate))
                where += " and pi_lastchgtime>='" + sdate + "'";
            if (!string.IsNullOrEmpty(edate))
                where += " and pi_lastchgtime<='" + edate + "'";
            select += ",(cast((cast(count(pi_no) as float)*100/(select case when count(pi_no)=0 then 1 else count(pi_no) end from personinfor inner join View_major on ma_id2=pi_spcode where " + where + ")) as numeric(5,2))) as pi_percent ";
            DataTable dt = new sql().PagingTable(" personinfor inner join View_major on ma_id2=pi_spcode ", select, where, groupby, sortField, sortOrder, pageSize, pageIndex, " pi_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            DataTable dt1 = new sql().GetSPersonCount(" personinfor inner join View_major on ma_id2=pi_spcode ", where);
            if (dt1 != null && dt1.Rows.Count > 0)
                result["personcount"] = dt1.Rows[0]["personcount"].ToString();
            else
                result["personcount"] = 0;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 人才信息统计（按求职意向）
    /// </summary>
    public void SPersonByYX()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = " pi_state=1 ";
            string table = "";
            string type = Request["type"];
            string sdate = Request["sdate"];
            string edate = Request["edate"];

            if (!string.IsNullOrEmpty(type) && !"0".Equals(type))
            {
                where += " and pi_yx1='" + type + "'";
                table = " personinfor inner join jobtype on jt_id=pi_yx11 ";
            }
            else
            {
                //where += " and jt_pid='0'";
                table = " personinfor inner join jobtype on jt_id=pi_yx1 ";
            }
            if (!string.IsNullOrEmpty(sdate))
                where += " and pi_lastchgtime>='" + sdate + "'";
            if (!string.IsNullOrEmpty(edate))
                where += " and pi_lastchgtime<='" + edate + "'";
            string groupby = " jt_id,jt_name ";
            DataTable dt = new sql().PagingTable(table, " jt_id,jt_name,count(pi_no) as pi_count,(cast((cast(count(pi_no) as float)*100/(select case when count(pi_no)=0 then 1 else count(pi_no) end from " + table + " where " + where + ")) as numeric(5,2))) as pi_percent ", where, groupby, sortField, sortOrder, pageSize, pageIndex, " pi_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            DataTable dt1 = new sql().GetSPersonCount(table, where);
            if (dt1 != null && dt1.Rows.Count > 0)
                result["personcount"] = dt1.Rows[0]["personcount"].ToString();
            else
                result["personcount"] = 0;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 人才信息统计（学历）
    /// </summary>
    public void SPersonByEdu()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = " pi_state=1 ";
            string sdate = Request["sdate"];
            string edate = Request["edate"];

            if (!string.IsNullOrEmpty(sdate))
                where += " and pi_lastchgtime>='" + sdate + "'";
            if (!string.IsNullOrEmpty(edate))
                where += " and pi_lastchgtime<='" + edate + "'";
            string groupby = " di_code,di_name ";
            DataTable dt = new sql().PagingTable(" personinfor inner join dictionary on di_code=pi_edu and di_type=4 ", " di_code,di_name,count(pi_no) as pi_count,(cast((cast(count(pi_no) as float)*100/(select case when count(pi_no)=0 then 1 else count(pi_no) end from personinfor inner join dictionary on di_code=pi_edu and di_type=4 where " + where + ")) as numeric(5,2))) as pi_percent ", where, groupby, sortField, sortOrder, pageSize, pageIndex, " pi_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            DataTable dt1 = new sql().GetSPersonCount(" personinfor inner join dictionary on di_code=pi_edu and di_type=4 ", where);
            if (dt1 != null && dt1.Rows.Count > 0)
                result["personcount"] = dt1.Rows[0]["personcount"].ToString();
            else
                result["personcount"] = 0;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 人才手机统计
    /// </summary>
    public void SPersonTel()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = " pi_state=1 and ((pi_mobile is not null and pi_mobile<>'') or (fw_mobile is not null and fw_mobile<>''))";
            string type1 = Request["type1"];
            string type2 = Request["type2"];
            string major1 = Request["major1"];
            string major2 = Request["major2"];
            string edu = Request["edu"];
            string sdate = Request["sdate"];
            string edate = Request["edate"];

            if (!string.IsNullOrEmpty(type1) && !"0".Equals(type1))
                where += " and (pi_yx1='" + type1 + "' or pi_yx2='" + type1 + "')";
            if (!string.IsNullOrEmpty(type2) && !"0".Equals(type2))
                where += " and (pi_yx11='" + type2 + "' or pi_yx22='" + type2 + "')";
            if (!string.IsNullOrEmpty(major1) && !"0".Equals(major1))
                where += " and ma_id1='" + major1 + "'";
            if (!string.IsNullOrEmpty(major2) && !"0".Equals(major2))
                where += " and pi_spcode='" + major2 + "'";
            if (!string.IsNullOrEmpty(edu) && !"0".Equals(edu))
                where += " and pi_edu='" + edu + "'";
            if (!string.IsNullOrEmpty(sdate))
                where += " and pi_logintime>='" + sdate + "'";
            if (!string.IsNullOrEmpty(edate))
                where += " and pi_logintime<='" + edate + "'";

            DataTable dt = new sql().PagingTable(" personinfor left join findwork on fw_pino=pi_no left join View_major on ma_id2=pi_spcode ", " *,(select di_name from dictionary where di_type=3 and di_code=pi_workarea) as area,(select di_name from dictionary where di_type=5 and di_code=pi_sex) as sex,(select ma_name from major where ma_id=pi_spcode) as spcode,(select di_name from dictionary where di_type=4 and di_code=pi_edu) as edu,(select di_name from dictionary where di_type=6 and di_code=pi_jobtype) as kind,(select jt_name from jobtype where jt_id=pi_yx1) as yx1,(select jt_name from jobtype where jt_id=pi_yx11) as yx11,(select jt_name from jobtype where jt_id=pi_yx2) as yx2,(select jt_name from jobtype where jt_id=pi_yx22) as yx22 ", where, sortField, sortOrder, pageSize, pageIndex, " pi_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************紧缺人才信息统计********************/
    /// <summary>
    /// 紧缺人才信息统计
    /// </summary>
    public void SNeed()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = " re_need=1 and re_needstate=1 ";
            string type1 = Request["type1"];
            string type2 = Request["type2"];
            string sdate = Request["sdate"];
            string edate = Request["edate"];

            if (!string.IsNullOrEmpty(type1) && !"0".Equals(type1))
                where += " and (re_jobtype1=" + type1 + " or re_jobtype2=" + type1 + ")";
            if (!string.IsNullOrEmpty(type2) && !"0".Equals(type2))
                where += " and (re_jobtype11=" + type2 + " or re_jobtype22=" + type2 + ")";
            if (!string.IsNullOrEmpty(sdate))
                where += " and re_inserttime>='" + sdate + "'";
            if (!string.IsNullOrEmpty(edate))
                where += " and re_inserttime<='" + edate + "'";

            DataTable dt = new sql().PagingTable(" recruit left join companyuser on re_cuno=cu_no ", " *,(select di_name from dictionary where di_type=3 and di_code=re_area) as area,(select di_name from dictionary where di_type=5 and di_code=re_sex) as sex,(select di_name from dictionary where di_type=6 and di_code=re_kind) as kind,(select di_name from dictionary where di_type=4 and di_code=re_edu) as edu,(select di_name from dictionary where di_type=7 and di_code=re_target) as target,(select jt_name from jobtype where jt_id=re_jobtype1) as jobtype1,(select jt_name from jobtype where jt_id=re_jobtype11) as jobtype11,(select jt_name from jobtype where jt_id=re_jobtype2) as jobtype2,(select jt_name from jobtype where jt_id=re_jobtype22) as jobtype22 ", where, sortField, sortOrder, pageSize, pageIndex, " re_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 紧缺职位统计（按职位类型）
    /// </summary>
    public void SNeedByType()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = " re_need=1 and re_needstate=1 ";
            string table = "";
            string type = Request["type"];
            string sdate = Request["sdate"];
            string edate = Request["edate"];

            if (!string.IsNullOrEmpty(type) && !"0".Equals(type))
            {
                where += " and re_jobtype1=" + type;
                table = " recruit inner join jobtype on jt_id=re_jobtype11 ";
            }
            else
            {
                //where += " and jt_pid='0'";
                table = " recruit inner join jobtype on jt_id=re_jobtype1 ";
            }
            if (!string.IsNullOrEmpty(sdate))
                where += " and re_inserttime>='" + sdate + "'";
            if (!string.IsNullOrEmpty(edate))
                where += " and re_inserttime<='" + edate + "'";
            string groupby = " jt_id,jt_name ";
            DataTable dt = new sql().PagingTable(table, " jt_id,jt_name,count(re_no) as re_count,(cast((cast(count(re_no) as float)*100/(select case when count(re_no)=0 then 1 else count(re_no) end from " + table + " where " + where + ")) as numeric(5,2))) as re_percent ", where, groupby, sortField, sortOrder, pageSize, pageIndex, " re_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            DataTable dt1 = new sql().GetSJobCount(table, where);
            if (dt1 != null && dt1.Rows.Count > 0)
                result["jobcount"] = dt1.Rows[0]["jobcount"].ToString();
            else
                result["jobcount"] = 0;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 紧缺职位统计（学历）
    /// </summary>
    public void SNeedByEdu()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = " re_need=1 and re_needstate=1 ";
            string sdate = Request["sdate"];
            string edate = Request["edate"];

            if (!string.IsNullOrEmpty(sdate))
                where += " and re_inserttime>='" + sdate + "'";
            if (!string.IsNullOrEmpty(edate))
                where += " and re_inserttime<='" + edate + "'";
            string groupby = " di_code,di_name ";
            DataTable dt = new sql().PagingTable(" recruit left join dictionary on di_code=re_edu and di_type=4 ", " di_code,di_name,count(re_no) as re_count ", where, groupby, sortField, sortOrder, pageSize, pageIndex, " re_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            DataTable dt1 = new sql().GetSJobCount(" recruit left join dictionary on di_code=re_edu and di_type=4 ", where);
            if (dt1 != null && dt1.Rows.Count > 0)
                result["jobcount"] = dt1.Rows[0]["jobcount"].ToString();
            else
                result["jobcount"] = 0;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************高级人才信息统计********************/
    /// <summary>
    /// 高级人才信息统计
    /// </summary>
    public void SHigh()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = " pi_high=1 and pi_highstate=1 ";
            string type1 = Request["type1"];
            string type2 = Request["type2"];
            string sdate = Request["sdate"];
            string edate = Request["edate"];

            if (!string.IsNullOrEmpty(type1) && !"0".Equals(type1))
                where += " and (pi_yx1=" + type1 + " or pi_yx2=" + type1 + ")";
            if (!string.IsNullOrEmpty(type2) && !"0".Equals(type2))
                where += " and (pi_yx11=" + type2 + " or pi_yx22=" + type2 + ")";
            if (!string.IsNullOrEmpty(sdate))
                where += " and pi_lastchgtime>='" + sdate + "'";
            if (!string.IsNullOrEmpty(edate))
                where += " and pi_lastchgtime<='" + edate + "'";

            DataTable dt = new sql().PagingTable(" personinfor ", " *,(select di_name from dictionary where di_type=3 and di_code=pi_workarea) as area,(select di_name from dictionary where di_type=5 and di_code=pi_sex) as sex,(select ma_name from major where ma_id=pi_spcode) as spcode,(select di_name from dictionary where di_type=4 and di_code=pi_edu) as edu,(select di_name from dictionary where di_type=6 and di_code=pi_jobtype) as kind,(select jt_name from jobtype where jt_id=pi_yx1) as yx1,(select jt_name from jobtype where jt_id=pi_yx11) as jobtype11,(select jt_name from jobtype where jt_id=pi_yx2) as yx2,(select jt_name from jobtype where jt_id=pi_yx22) as yx22 ", where, sortField, sortOrder, pageSize, pageIndex, " pi_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 高级人才统计（按专业类型）
    /// </summary>
    public void SHighByMajor()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = " pi_state=1 and (pi_edu in ('7','8','9') or pi_zhicheng in ('中级职称','高级职称')) ";
            string select = "";
            string groupby = "";
            string type = Request["type"];
            string sdate = Request["sdate"];
            string edate = Request["edate"];

            if (!string.IsNullOrEmpty(type) && !"0".Equals(type))
            {
                where += " and ma_id1='" + type + "'";
                select = " ma_id2 as ma_id,ma_name2 as ma_name,count(pi_no) as pi_count ";
                groupby = "ma_id2,ma_name2";
            }
            else
            {
                select = " ma_id1 as ma_id,ma_name1 as ma_name,count(pi_no) as pi_count ";
                groupby = "ma_id1,ma_name1";
            }
            if (!string.IsNullOrEmpty(sdate))
                where += " and pi_lastchgtime>='" + sdate + "'";
            if (!string.IsNullOrEmpty(edate))
                where += " and pi_lastchgtime<='" + edate + "'";
            select += ",(cast((cast(count(pi_no) as float)*100/(select case when count(pi_no)=0 then 1 else count(pi_no) end from personinfor inner join View_major on ma_id2=pi_spcode where " + where + ")) as numeric(5,2))) as pi_percent ";
            DataTable dt = new sql().PagingTable(" personinfor inner join View_major on ma_id2=pi_spcode ", select, where, groupby, sortField, sortOrder, pageSize, pageIndex, " pi_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            DataTable dt1 = new sql().GetSPersonCount(" personinfor inner join View_major on ma_id2=pi_spcode ", where);
            if (dt1 != null && dt1.Rows.Count > 0)
                result["personcount"] = dt1.Rows[0]["personcount"].ToString();
            else
                result["personcount"] = 0;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 高级人才统计（按求职意向）
    /// </summary>
    public void SHighByYX()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = " pi_state=1 and (pi_edu in ('7','8','9') or pi_zhicheng in ('中级职称','高级职称')) ";
            string table = "";
            string type = Request["type"];
            string sdate = Request["sdate"];
            string edate = Request["edate"];

            if (!string.IsNullOrEmpty(type) && !"0".Equals(type))
            {
                where += " and pi_yx1='" + type + "'";
                table = " personinfor inner join jobtype on jt_id=pi_yx11 ";
            }
            else
            {
                where += " and jt_pid='0'";
                table = " personinfor inner join jobtype on jt_id=pi_yx1 ";
            }
            if (!string.IsNullOrEmpty(sdate))
                where += " and pi_lastchgtime>='" + sdate + "'";
            if (!string.IsNullOrEmpty(edate))
                where += " and pi_lastchgtime<='" + edate + "'";
            string groupby = " jt_id,jt_name ";
            DataTable dt = new sql().PagingTable(table, " jt_id,jt_name,count(pi_no) as pi_count,(cast((cast(count(pi_no) as float)*100/(select case when count(pi_no)=0 then 1 else count(pi_no) end from " + table + " where " + where + ")) as numeric(5,2))) as pi_percent ", where, groupby, sortField, sortOrder, pageSize, pageIndex, " pi_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            DataTable dt1 = new sql().GetSPersonCount(table, where);
            if (dt1 != null && dt1.Rows.Count > 0)
                result["personcount"] = dt1.Rows[0]["personcount"].ToString();
            else
                result["personcount"] = 0;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 高级人才统计（学历）
    /// </summary>
    public void SHighByEdu()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = " pi_state=1 and (pi_edu in ('7','8','9') or pi_zhicheng in ('中级职称','高级职称')) ";
            string sdate = Request["sdate"];
            string edate = Request["edate"];

            if (!string.IsNullOrEmpty(sdate))
                where += " and pi_lastchgtime>='" + sdate + "'";
            if (!string.IsNullOrEmpty(edate))
                where += " and pi_lastchgtime<='" + edate + "'";
            string groupby = " di_code,di_name ";
            DataTable dt = new sql().PagingTable(" personinfor inner join dictionary on di_code=pi_edu and di_type=4 ", " di_code,di_name,count(pi_no) as pi_count,(cast((cast(count(pi_no) as float)*100/(select case when count(pi_no)=0 then 1 else count(pi_no) end from personinfor left join dictionary on di_code=pi_edu and di_type=4 where " + where + ")) as numeric(5,2))) as pi_percent ", where, groupby, sortField, sortOrder, pageSize, pageIndex, " pi_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            DataTable dt1 = new sql().GetSPersonCount(" personinfor inner join dictionary on di_code=pi_edu and di_type=4 ", where);
            if (dt1 != null && dt1.Rows.Count > 0)
                result["personcount"] = dt1.Rows[0]["personcount"].ToString();
            else
                result["personcount"] = 0;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /******************未就业毕业生信息统计********************/
    /// <summary>
    /// 未就业毕业生信息统计
    /// </summary>
    public void SStudent()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = " st_state=1 ";
            string edu = Request["edu"];
            string hard = Request["hard"];
            string will1 = Request["will1"];
            string will2 = Request["will2"];
            string need = Request["need"];
            string go = Request["goto"];
            string sdate = Request["sdate"];
            string edate = Request["edate"];

            if (!string.IsNullOrEmpty(edu) && !"0".Equals(edu))
                where += " and st_education='" + edu + "'";
            if (!string.IsNullOrEmpty(hard) && !"-1".Equals(hard))
                where += " and st_hard=" + hard;
            if (!string.IsNullOrEmpty(will1) && !"0".Equals(will1))
            {
                if ("其他地区".Equals(will1))
                    where += " and st_willarea not in ('不限','本市','本省') ";
                else
                    where += " and st_willarea='" + will1 + "'";
            }
            if (!string.IsNullOrEmpty(will2) && !"0".Equals(will2))
                where += " and st_willkind='" + will2 + "'";
            if (!string.IsNullOrEmpty(need) && !"0".Equals(need))
                where += " and st_need like '%," + need + ",%'";
            if (!string.IsNullOrEmpty(go) && !"0".Equals(go))
                where += " and st_goto=" + go;
            if (!string.IsNullOrEmpty(sdate))
                where += " and st_finishtime>='" + sdate + "'";
            if (!string.IsNullOrEmpty(edate))
                where += " and st_finishtime<='" + edate + "'";

            DataTable dt = new sql().PagingTable(" student ", " * ", where, sortField, sortOrder, pageSize, pageIndex, " st_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /**********************************************/

    /// <summary>
    /// 所属行业Combox
    /// </summary>
    public void CbxTradeAll()
    {
        DataTable dt = new sql().GetDictionaryByType(1, 1);
        if (dt != null && dt.Rows.Count > 0)
        {
            DataRow dr = dt.NewRow();
            dr["di_code"] = "0";
            dr["di_name"] = "全部";
            dt.Rows.InsertAt(dr, 0);
        }
        String json = JSON.Encode(dt);
        Response.Write(json);
    }

    /// <summary>
    /// 企业按行业统计
    /// </summary>
    public void SCompanyByTrade()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = " cu_state=1 ";
            string sdate = Request["sdate"];
            string edate = Request["edate"];

            if (!string.IsNullOrEmpty(sdate))
                where += " and cu_apptime>='" + sdate + "'";
            if (!string.IsNullOrEmpty(edate))
                where += " and cu_apptime<='" + edate + "'";
            string groupby = " di_code,di_name ";
            DataTable dt = new sql().PagingTable(" companyuser inner join dictionary on di_code=cu_trade and di_type=1 ", " di_code,di_name,count(cu_no) as cu_count,(cast((cast(count(cu_no) as float)*100/(select case when count(cu_no)=0 then 1 else count(cu_no) end from companyuser inner join dictionary on di_code=cu_trade and di_type=1 where " + where + ")) as numeric(5,2))) as cu_percent ", where, groupby, sortField, sortOrder, pageSize, pageIndex, " cu_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            DataTable dt1 = new sql().GetSCompanyCount(" companyuser inner join dictionary on di_code=cu_trade and di_type=1 ", where);
            if (dt1 != null && dt1.Rows.Count > 0)
                result["companycount"] = dt1.Rows[0]["companycount"].ToString();
            else
                result["companycount"] = 0;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 企业按类型统计
    /// </summary>
    public void SCompanyByType()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = " re_state=1 and re_jobtype1 in (select jt_id from jobtype)";
            string sdate = Request["sdate"];
            string edate = Request["edate"];
            string category = Request["category"];
            if (!string.IsNullOrEmpty(sdate))
                where += " and re_inserttime>='" + sdate + "'";
            if (!string.IsNullOrEmpty(edate))
                where += " and re_inserttime<='" + edate + "'";
            if (!string.IsNullOrEmpty(category))
                where += " and cu_category like'%" + category + "%'";

            DataTable dt = new sql().PagingTable("  recruit left join companyuser on re_cuno=cu_no ", "re_kind,re_pay1,re_sex,re_edu,re_area,re_jobtype11,re_jobtype1,re_effecttime,re_delaytime,re_cuno,cu_name,cu_contact,cu_tel,re_name,re_num,(select di_name from dictionary where di_code=re_kind and di_type=6) as kind,(case re_pay1 when '1'  then    '1000~1500' when '2' then  '1500~2000' when '3' then '2000~3000' when '4'  then '3000~5000' when '5'  then '5000~10000' when '6'   then '10000以上' else    '面议' end) as salary,(select di_name from dictionary where di_code=re_sex and di_type=5) as sex,(select di_name from dictionary where di_code=re_edu and di_type=4) as edu,(select di_name from dictionary where di_code=re_area and di_type=3) as area,ISNULL ( (select jt_name from jobtype where jt_id=re_jobtype11),(select jt_name from jobtype where jt_id=re_jobtype1))   as positionType,re_inserttime,DATEADD(day,re_effecttime,re_delaytime) as deadline,re_memo", where, sortField, sortOrder, pageSize, pageIndex, " re_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 首页广告信息
    /// </summary>
    public void GetHtmlList()
    {
        try
        {
            ArrayList data = new sql().GetHtmlList();
            string json = JSON.Encode(data);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    public void CreateHtml()
    {
        try
        {
            //bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1506");
            //if (!flg)
            //{
            //    Response.Write("no");
            //    return;
            //}

            DataTable ad1 = new sql().GetAdList(1);
            string strad1 = "";
            if (ad1 != null && ad1.Rows.Count > 0)
            {
                strad1 += "<div class='adv1' onmouseout='show1(1)' onmouseover='stoproll1()'>";
                strad1 += "<img style='width:760px;height:70px;' src='image/logright.jpg' />";
                strad1 += "</div>";
                for (int i = 0; i < ad1.Rows.Count; i++)
                {
                    if (i == ad1.Rows.Count - 1)
                    {
                        strad1 += "<div class='adv1' onmouseout='show1(" + (i + 2) + ")' onmouseover='stoproll1()' style='display:none;'>";
                        strad1 += "<a target='_blank' href='" + ad1.Rows[0]["ad_url"].ToString() + "'><img style='width:760px;height:70px;' src='" + ad1.Rows[0]["ad_img"].ToString() + "' /></a>";
                        strad1 += "</div>";
                    }
                    else
                    {
                        strad1 += "<div class='adv1' onmouseout='show1(0)' onmouseover='stoproll1()'>";
                        strad1 += "<a target='_blank' href='" + ad1.Rows[0]["ad_url"].ToString() + "'><img style='width:760px;height:70px;' src='" + ad1.Rows[0]["ad_img"].ToString() + "' /></a>";
                        strad1 += "</div>";
                    }
                }
            }
            else
            {
                strad1 += "<div class='adv1'>";
                strad1 += "<img style='width:760px;height:70px;' src='image/logright.jpg' />";
                strad1 += "</div>";
            }

            DataTable ad2 = new sql().GetAdList(2);
            string strad2 = "";
            if (ad2.Rows.Count > 8)
            {
                strad2 += "<div id='demo1' style='overflow:hidden;height:650px;width:980px;margin-bottom:5px;'>";
                strad2 += "<div id='demo11'>";
            }
            for (int i = 0; i < ad2.Rows.Count; i++)
            {
                strad2 += "<div class='adv3'><a target='_blank' href='" + ad2.Rows[i]["ad_url"].ToString() + "'><img style='width:980px;height:80px;' src='" + ad2.Rows[i]["ad_img"].ToString() + "' /></a></div>";
            }
            if (ad2.Rows.Count > 8)
            {
                strad2 += "</div>";
                strad2 += "<div id='demo12'></div>";
                strad2 += "</div>";
            }

            DataTable ad3 = new sql().GetAdList(3);
            string strad3 = "";
            if (ad3.Rows.Count > 6)
            {
                strad3 += "<div id='demo2' style='overflow:hidden;height:430px;width:980px;margin-bottom:5px;'>";
                strad3 += "<div id='demo21'>";
            }
            for (int i = 0; i < ad3.Rows.Count; i++)
            {
                if (i % 2 == 0)
                    strad3 += "<div class='adv4'><a target='_blank' style='margin-right:10px' href='" + ad3.Rows[i]["ad_url"].ToString() + "'><img style='width:485px;height:70px;' src='" + ad3.Rows[i]["ad_img"].ToString() + "' /></a>";
                else
                    strad3 += "<a target='_blank' href='" + ad3.Rows[i]["ad_url"].ToString() + "'><img style='width:485px;height:70px;' src='" + ad3.Rows[i]["ad_img"].ToString() + "' /></a></div>";
            }
            if (ad3.Rows.Count % 2 == 1)
            {
                strad3 += "<a><img style='width:485px;height:70px;' src='image/xwyd3.jpg' /></a></div>";
            }
            if (ad3.Rows.Count > 6)
            {
                strad3 += "</div>";
                strad3 += "<div id='demo22'></div>";
                strad3 += "</div>";
            }

            DataTable ad4 = new sql().GetAdList2(4);
            DataTable ad42 = new DataTable();
            string strad4 = "";
            if (ad4.Rows.Count > 48)
            {
                strad4 += "<div id='demo3' style='overflow:hidden;height:555px;width:980px;margin-bottom:5px;'>";
                strad4 += "<div id='demo31'>";
            }
            if (ad4.Rows.Count < 48)
                ad42 = new sql().GetAdList3(4);
            if (ad4.Rows.Count > 0 || ad42.Rows.Count > 0)
                strad4 += "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
            for (int i = 0; i < ad4.Rows.Count; i++)
            {
                if (i % 6 == 0)
                {
                    if (ad4.Rows[i]["ad_title"].ToString().Length > 12)
                        strad4 += "<tr><td class='gd31'><div><a target='_blank' href='" + ad4.Rows[i]["ad_url"].ToString() + "' title='" + ad4.Rows[i]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad4.Rows[i]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad4.Rows[i]["ad_url"].ToString() + "' title='" + ad4.Rows[i]["ad_title"].ToString() + "'>" + ad4.Rows[i]["ad_title"].ToString().Substring(0, 12) + "</a></div></td>";
                    else
                        strad4 += "<tr><td class='gd31'><div><a target='_blank' href='" + ad4.Rows[i]["ad_url"].ToString() + "' title='" + ad4.Rows[i]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad4.Rows[i]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad4.Rows[i]["ad_url"].ToString() + "' title='" + ad4.Rows[i]["ad_title"].ToString() + "'>" + ad4.Rows[i]["ad_title"].ToString() + "</a></div></td>";
                }
                else if (i % 6 == 5)
                {
                    if (ad4.Rows[i]["ad_title"].ToString().Length > 12)
                        strad4 += "<td class='gd33'><div><a target='_blank' href='" + ad4.Rows[i]["ad_url"].ToString() + "' title='" + ad4.Rows[i]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad4.Rows[i]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad4.Rows[i]["ad_url"].ToString() + "' title='" + ad4.Rows[i]["ad_title"].ToString() + "'>" + ad4.Rows[i]["ad_title"].ToString().Substring(0, 12) + "</a></div></td></tr>";
                    else
                        strad4 += "<td class='gd33'><div><a target='_blank' href='" + ad4.Rows[i]["ad_url"].ToString() + "' title='" + ad4.Rows[i]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad4.Rows[i]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad4.Rows[i]["ad_url"].ToString() + "' title='" + ad4.Rows[i]["ad_title"].ToString() + "'>" + ad4.Rows[i]["ad_title"].ToString() + "</a></div></td></tr>";
                }
                else
                {
                    if (ad4.Rows[i]["ad_title"].ToString().Length > 12)
                        strad4 += "<td class='gd32'><div><a target='_blank' href='" + ad4.Rows[i]["ad_url"].ToString() + "' title='" + ad4.Rows[i]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad4.Rows[i]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad4.Rows[i]["ad_url"].ToString() + "' title='" + ad4.Rows[i]["ad_title"].ToString() + "'>" + ad4.Rows[i]["ad_title"].ToString().Substring(0, 12) + "</a></div></td>";
                    else
                        strad4 += "<td class='gd32'><div><a target='_blank' href='" + ad4.Rows[i]["ad_url"].ToString() + "' title='" + ad4.Rows[i]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad4.Rows[i]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad4.Rows[i]["ad_url"].ToString() + "' title='" + ad4.Rows[i]["ad_title"].ToString() + "'>" + ad4.Rows[i]["ad_title"].ToString() + "</a></div></td>";
                }
            }
            if (ad4.Rows.Count < 48)
            {
                for (int i = 0; i < ad42.Rows.Count - ad4.Rows.Count; i++)
                {
                    if ((i + ad4.Rows.Count) % 6 == 0)
                    {
                        if (ad42.Rows[i]["ad_title"].ToString().Length > 12)
                            strad4 += "<tr><td class='gd31'><div><a target='_blank' href='" + ad42.Rows[i]["ad_url"].ToString() + "' title='" + ad42.Rows[i]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad42.Rows[i]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad42.Rows[i]["ad_url"].ToString() + "' title='" + ad42.Rows[i]["ad_title"].ToString() + "'>" + ad42.Rows[i]["ad_title"].ToString().Substring(0, 12) + "</a></div></td>";
                        else
                            strad4 += "<tr><td class='gd31'><div><a target='_blank' href='" + ad42.Rows[i]["ad_url"].ToString() + "' title='" + ad42.Rows[i]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad42.Rows[i]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad42.Rows[i]["ad_url"].ToString() + "' title='" + ad42.Rows[i]["ad_title"].ToString() + "'>" + ad42.Rows[i]["ad_title"].ToString() + "</a></div></td>";
                    }
                    else if ((i + ad4.Rows.Count) % 6 == 5)
                    {
                        if (ad42.Rows[i]["ad_title"].ToString().Length > 12)
                            strad4 += "<td class='gd33'><div><a target='_blank' href='" + ad42.Rows[i]["ad_url"].ToString() + "' title='" + ad42.Rows[i]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad42.Rows[i]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad42.Rows[i]["ad_url"].ToString() + "' title='" + ad42.Rows[i]["ad_title"].ToString() + "'>" + ad42.Rows[i]["ad_title"].ToString().Substring(0, 12) + "</a></div></td></tr>";
                        else
                            strad4 += "<td class='gd33'><div><a target='_blank' href='" + ad42.Rows[i]["ad_url"].ToString() + "' title='" + ad42.Rows[i]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad42.Rows[i]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad42.Rows[i]["ad_url"].ToString() + "' title='" + ad42.Rows[i]["ad_title"].ToString() + "'>" + ad42.Rows[i]["ad_title"].ToString() + "</a></div></td></tr>";
                    }
                    else
                    {
                        if (ad42.Rows[i]["ad_title"].ToString().Length > 12)
                            strad4 += "<td class='gd32'><div><a target='_blank' href='" + ad42.Rows[i]["ad_url"].ToString() + "' title='" + ad42.Rows[i]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad42.Rows[i]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad42.Rows[i]["ad_url"].ToString() + "' title='" + ad42.Rows[i]["ad_title"].ToString() + "'>" + ad42.Rows[i]["ad_title"].ToString().Substring(0, 12) + "</a></div></td>";
                        else
                            strad4 += "<td class='gd32'><div><a target='_blank' href='" + ad42.Rows[i]["ad_url"].ToString() + "' title='" + ad42.Rows[i]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad42.Rows[i]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad42.Rows[i]["ad_url"].ToString() + "' title='" + ad42.Rows[i]["ad_title"].ToString() + "'>" + ad42.Rows[i]["ad_title"].ToString() + "</a></div></td>";
                    }
                }
            }
            else
            {
                if (ad4.Rows.Count % 6 == 1)
                {
                    strad4 += "<td class='gd32'><div><a target='_blank' href='" + ad42.Rows[0]["ad_url"].ToString() + "' title='" + ad42.Rows[0]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad42.Rows[0]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad42.Rows[0]["ad_url"].ToString() + "' title='" + ad42.Rows[0]["ad_title"].ToString() + "'>" + ad42.Rows[0]["ad_title"].ToString().Substring(0, 12) + "</a></div></td>";
                    strad4 += "<td class='gd32'><div><a target='_blank' href='" + ad42.Rows[1]["ad_url"].ToString() + "' title='" + ad42.Rows[1]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad42.Rows[1]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad42.Rows[1]["ad_url"].ToString() + "' title='" + ad42.Rows[1]["ad_title"].ToString() + "'>" + ad42.Rows[1]["ad_title"].ToString().Substring(0, 12) + "</a></div></td>";
                    strad4 += "<td class='gd32'><div><a target='_blank' href='" + ad42.Rows[2]["ad_url"].ToString() + "' title='" + ad42.Rows[2]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad42.Rows[2]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad42.Rows[2]["ad_url"].ToString() + "' title='" + ad42.Rows[2]["ad_title"].ToString() + "'>" + ad42.Rows[2]["ad_title"].ToString().Substring(0, 12) + "</a></div></td>";
                    strad4 += "<td class='gd32'><div><a target='_blank' href='" + ad42.Rows[3]["ad_url"].ToString() + "' title='" + ad42.Rows[3]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad42.Rows[3]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad42.Rows[3]["ad_url"].ToString() + "' title='" + ad42.Rows[3]["ad_title"].ToString() + "'>" + ad42.Rows[3]["ad_title"].ToString().Substring(0, 12) + "</a></div></td>";
                    strad4 += "<td class='gd32'><div><a target='_blank' href='" + ad42.Rows[4]["ad_url"].ToString() + "' title='" + ad42.Rows[4]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad42.Rows[4]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad42.Rows[4]["ad_url"].ToString() + "' title='" + ad42.Rows[4]["ad_title"].ToString() + "'>" + ad42.Rows[4]["ad_title"].ToString().Substring(0, 12) + "</a></div></td></tr>";
                }
                else if (ad4.Rows.Count % 6 == 2)
                {
                    strad4 += "<td class='gd32'><div><a target='_blank' href='" + ad42.Rows[0]["ad_url"].ToString() + "' title='" + ad42.Rows[0]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad42.Rows[0]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad42.Rows[0]["ad_url"].ToString() + "' title='" + ad42.Rows[0]["ad_title"].ToString() + "'>" + ad42.Rows[0]["ad_title"].ToString().Substring(0, 12) + "</a></div></td>";
                    strad4 += "<td class='gd32'><div><a target='_blank' href='" + ad42.Rows[1]["ad_url"].ToString() + "' title='" + ad42.Rows[1]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad42.Rows[1]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad42.Rows[1]["ad_url"].ToString() + "' title='" + ad42.Rows[1]["ad_title"].ToString() + "'>" + ad42.Rows[1]["ad_title"].ToString().Substring(0, 12) + "</a></div></td>";
                    strad4 += "<td class='gd32'><div><a target='_blank' href='" + ad42.Rows[2]["ad_url"].ToString() + "' title='" + ad42.Rows[2]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad42.Rows[2]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad42.Rows[2]["ad_url"].ToString() + "' title='" + ad42.Rows[2]["ad_title"].ToString() + "'>" + ad42.Rows[2]["ad_title"].ToString().Substring(0, 12) + "</a></div></td>";
                    strad4 += "<td class='gd32'><div><a target='_blank' href='" + ad42.Rows[3]["ad_url"].ToString() + "' title='" + ad42.Rows[3]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad42.Rows[3]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad42.Rows[3]["ad_url"].ToString() + "' title='" + ad42.Rows[3]["ad_title"].ToString() + "'>" + ad42.Rows[3]["ad_title"].ToString().Substring(0, 12) + "</a></div></td></tr>";
                }
                else if (ad4.Rows.Count % 6 == 3)
                {
                    strad4 += "<td class='gd32'><div><a target='_blank' href='" + ad42.Rows[0]["ad_url"].ToString() + "' title='" + ad42.Rows[0]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad42.Rows[0]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad42.Rows[0]["ad_url"].ToString() + "' title='" + ad42.Rows[0]["ad_title"].ToString() + "'>" + ad42.Rows[0]["ad_title"].ToString().Substring(0, 12) + "</a></div></td>";
                    strad4 += "<td class='gd32'><div><a target='_blank' href='" + ad42.Rows[1]["ad_url"].ToString() + "' title='" + ad42.Rows[1]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad42.Rows[1]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad42.Rows[1]["ad_url"].ToString() + "' title='" + ad42.Rows[1]["ad_title"].ToString() + "'>" + ad42.Rows[1]["ad_title"].ToString().Substring(0, 12) + "</a></div></td>";
                    strad4 += "<td class='gd32'><div><a target='_blank' href='" + ad42.Rows[2]["ad_url"].ToString() + "' title='" + ad42.Rows[2]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad42.Rows[2]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad42.Rows[2]["ad_url"].ToString() + "' title='" + ad42.Rows[2]["ad_title"].ToString() + "'>" + ad42.Rows[2]["ad_title"].ToString().Substring(0, 12) + "</a></div></td></tr>";
                }
                else if (ad4.Rows.Count % 6 == 4)
                {
                    strad4 += "<td class='gd32'><div><a target='_blank' href='" + ad42.Rows[0]["ad_url"].ToString() + "' title='" + ad42.Rows[0]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad42.Rows[0]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad42.Rows[0]["ad_url"].ToString() + "' title='" + ad42.Rows[0]["ad_title"].ToString() + "'>" + ad42.Rows[0]["ad_title"].ToString().Substring(0, 12) + "</a></div></td>";
                    strad4 += "<td class='gd32'><div><a target='_blank' href='" + ad42.Rows[1]["ad_url"].ToString() + "' title='" + ad42.Rows[1]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad42.Rows[1]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad42.Rows[1]["ad_url"].ToString() + "' title='" + ad42.Rows[1]["ad_title"].ToString() + "'>" + ad42.Rows[1]["ad_title"].ToString().Substring(0, 12) + "</a></div></td></tr>";
                }
                else if (ad4.Rows.Count % 6 == 5)
                    strad4 += "<td class='gd32'><div><a target='_blank' href='" + ad42.Rows[0]["ad_url"].ToString() + "' title='" + ad42.Rows[0]["ad_title"].ToString() + "'><img style='width:150px;height:40px;' src='" + ad42.Rows[0]["ad_img"].ToString() + "' /></a><br /><a target='_blank' href='" + ad42.Rows[0]["ad_url"].ToString() + "' title='" + ad42.Rows[0]["ad_title"].ToString() + "'>" + ad42.Rows[0]["ad_title"].ToString().Substring(0, 12) + "</a></div></td></tr>";
            }
            if (ad4.Rows.Count > 0 || ad42.Rows.Count > 0)
                strad4 += "</table>";
            if (ad4.Rows.Count > 48)
            {
                strad4 += "</div>";
                strad4 += "<div id='demo32'></div>";
                strad4 += "</div>";
            }

            DataTable ad5 = new sql().GetAdList(5);
            string strad5 = "";
            string strad6 = "";
            if (ad5 != null && ad5.Rows.Count > 0)
            {
                if (ad5.Rows.Count == 1)
                {
                    strad5 = "<div id='lovexin12' style='left:0px;POSITION:absolute;TOP:50px;z-index: 1000;'><div style='padding-top:18px'><a target='_blank' href='" + ad5.Rows[0]["ad_url"].ToString() + "'><img style='width:130px;height:340px;' src='" + ad5.Rows[0]["ad_img"].ToString() + "' /></a></div><div align='right' style='position: absolute;top:-5px;right:0px;margin:2px;padding:2px;z-index:2000;'><a href='javascript:void(0);' onclick='hidead(1)' style='color:#000000;text-decoration:none;font-size:12px;'>关闭</a></div></div>";
                    strad6 = "<div id='lovexin14' style='right:0px;POSITION:absolute;TOP:50px;z-index: 1000;'><div align='right' style='position: absolute;top:-5px;left:0px;margin:2px;padding:2px;z-index:2000;'><a href='javascript:void(0);' onclick='hidead(2)' style='color:#000000;text-decoration:none;font-size:12px;'>关闭</a></div><div style='padding-top:18px'><a target='_blank' href='" + ad5.Rows[0]["ad_url"].ToString() + "'><img style='width:130px;height:340px;' src='" + ad5.Rows[0]["ad_img"].ToString() + "' /></a></div></div>";
                }
                else
                {
                    for (int i = 0; i < ad5.Rows.Count; i++)
                    {
                        if (i == 0)
                        {
                            strad5 = "<div id='lovexin12' style='left:0px;POSITION:absolute;TOP:50px;z-index: 1000;'><div style='padding-top:18px'><div class='adv21' onmouseout='show2(1)' onmouseover='stoproll2()'><a target='_blank' href='" + ad5.Rows[0]["ad_url"].ToString() + "'><img style='width:130px;height:340px;' src='" + ad5.Rows[0]["ad_img"].ToString() + "' /></a></div>";
                            strad6 = "<div id='lovexin14' style='right:0px;POSITION:absolute;TOP:50px;z-index: 1000;'><div align='right' style='position: absolute;top:-5px;left:0px;margin:2px;padding:2px;z-index:2000;'><a href='javascript:void(0);' onclick='hidead(2)' style='color:#000000;text-decoration:none;font-size:12px;'>关闭</a></div><div style='padding-top:18px'><div class='adv22' onmouseout='show2(1)' onmouseover='stoproll2()'><a target='_blank' href='" + ad5.Rows[0]["ad_url"].ToString() + "'><img style='width:130px;height:340px;' src='" + ad5.Rows[0]["ad_img"].ToString() + "' /></a></div>";
                        }
                        else if (i == ad5.Rows.Count-1)
                        {
                            strad5 += "<div class='adv21' onmouseout='show2(" + (i + 1) + ")' onmouseover='stoproll2()' style='display:none;'><a target='_blank' href='" + ad5.Rows[i]["ad_url"].ToString() + "'><img style='width:130px;height:340px;' src='" + ad5.Rows[i]["ad_img"].ToString() + "' /></a></div></div><div align='right' style='position: absolute;top:-5px;right:0px;margin:2px;padding:2px;z-index:2000;'><a href='javascript:void(0);' onclick='hidead(1)' style='color:#000000;text-decoration:none;font-size:12px;'>关闭</a></div></div>";
                            strad6 += "<div class='adv22' onmouseout='show2(" + (i + 1) + ")' onmouseover='stoproll2()' style='display:none;'><a target='_blank' href='" + ad5.Rows[i]["ad_url"].ToString() + "'><img style='width:130px;height:340px;' src='" + ad5.Rows[i]["ad_img"].ToString() + "' /></a></div></div></div>";
                        }
                        else
                        {
                            strad5 += "<div class='adv21' onmouseout='show2(" + (i + 1) + ")' onmouseover='stoproll2()' style='display:none;'><a target='_blank' href='" + ad5.Rows[i]["ad_url"].ToString() + "'><img style='width:130px;height:340px;' src='" + ad5.Rows[i]["ad_img"].ToString() + "' /></a></div>";
                            strad6 += "<div class='adv22' onmouseout='show2(" + (i + 1) + ")' onmouseover='stoproll2()' style='display:none;'><a target='_blank' href='" + ad5.Rows[i]["ad_url"].ToString() + "'><img style='width:130px;height:340px;' src='" + ad5.Rows[i]["ad_img"].ToString() + "' /></a></div>";
                        }
                    }
                }
            }
            else
            {
                strad5 = "<div id='lovexin12' style='display:none;left:0px;POSITION:absolute;TOP:50px;z-index: 1000;'></div>";
                strad6 = "<div id='lovexin14' style='display:none;right:0px;POSITION:absolute;TOP:50px;z-index: 1000;'></div>";
            }

            DataTable ad6 = new sql().GetAdList(6);
            string strad7 = "";
            for (int i = 0; i < ad6.Rows.Count; i++)
            {
                strad7 += "<div class='adv3'><a target='_blank' href='" + ad6.Rows[i]["ad_url"].ToString() + "'><img style='width:980px;height:80px;' src='" + ad6.Rows[i]["ad_img"].ToString() + "' /></a></div>";
            }

            DataTable newsxin = new sql().GetNewsList(14);
            string strnewsxin = "";
            for (int i = 0; i < newsxin.Rows.Count; i++)
            {
                strnewsxin += "<li><span class='newstitle_new'><a target='_blank'";
                strnewsxin += " title='" + newsxin.Rows[i]["nw_title"].ToString() + "'";
                if ("1".Equals(newsxin.Rows[i]["nw_red"].ToString()))
                    strnewsxin += " style='color:Red'";
                if (!string.IsNullOrEmpty(newsxin.Rows[i]["nw_url"].ToString()))
                    strnewsxin += "href='" + newsxin.Rows[i]["nw_url"].ToString();
                else
                    strnewsxin += "href='News/" + newsxin.Rows[i]["nw_no"].ToString() + ".html";
                string title = newsxin.Rows[i]["nw_title"].ToString();
                if (title.Length > 30)
                    title = title.Substring(0, 28) + "...";
                strnewsxin += "'>" + title;
                if (Convert.ToInt32(newsxin.Rows[i]["dtime"].ToString())<=5)
                    strnewsxin += "</a>&nbsp;&nbsp;&nbsp;<img src='image/new.gif' style='width:22px;hight:9px;'/>";
                else
                    strnewsxin += "</a>";
                strnewsxin += "</span><span>";
                strnewsxin += string.Format("{0:yyyy/MM/dd}", newsxin.Rows[i]["nw_modifytime"]) + "</span></li>";
            }

            DataTable newstong = new sql().GetNewsList(13);
            string strnewstong = "";
            for (int i = 0; i < newstong.Rows.Count; i++)
            {
                strnewstong += "<li><span class='newstitle_new'><a target='_blank'";
                strnewstong += " title='" + newstong.Rows[i]["nw_title"].ToString() + "'";
                if ("1".Equals(newstong.Rows[i]["nw_red"].ToString()))
                    strnewstong += " style='color:Red'";
                if (!string.IsNullOrEmpty(newstong.Rows[i]["nw_url"].ToString()))
                    strnewstong += " href='" + newstong.Rows[i]["nw_url"].ToString();
                else
                    strnewstong += " href='News/" + newstong.Rows[i]["nw_no"].ToString() + ".html";
                string title = newstong.Rows[i]["nw_title"].ToString();
                if (title.Length > 30)
                    title = title.Substring(0, 28) + "...";
                strnewstong += "'>" + title;
                if (Convert.ToInt32(newstong.Rows[i]["dtime"].ToString()) <= 5)
                    strnewstong += "</a>&nbsp;&nbsp;&nbsp;<img src='image/new.gif' style='width:22px;hight:9px;'/>";
                else
                    strnewstong += "</a>";
                strnewstong += "</span><span>";
                strnewstong += string.Format("{0:yyyy/MM/dd}", newstong.Rows[i]["nw_modifytime"]) + "</span></li>";
            }

            DataTable newscheng = new sql().GetNewsList(15);
            string strnewscheng = "";
            for (int i = 0; i < newscheng.Rows.Count; i++)
            {
                strnewscheng += "<li><span class='newstitle_new'><a target='_blank'";
                strnewscheng += " title='" + newscheng.Rows[i]["nw_title"].ToString() + "'";
                if ("1".Equals(newscheng.Rows[i]["nw_red"].ToString()))
                    strnewscheng += " style='color:Red'";
                if (!string.IsNullOrEmpty(newscheng.Rows[i]["nw_url"].ToString()))
                    strnewscheng += " href='" + newscheng.Rows[i]["nw_url"].ToString();
                else
                    strnewscheng += " href='News/" + newscheng.Rows[i]["nw_no"].ToString() + ".html";
                string title = newscheng.Rows[i]["nw_title"].ToString();
                if (title.Length > 30)
                    title = title.Substring(0, 28) + "...";
                strnewscheng += "'>" + title;
                if (Convert.ToInt32(newscheng.Rows[i]["dtime"].ToString()) <= 5)
                    strnewscheng += "</a>&nbsp;&nbsp;&nbsp;<img src='image/new.gif' style='width:22px;hight:9px;'/>";
                else
                    strnewscheng += "</a>";
                strnewscheng += "</span><span>";
                strnewscheng += string.Format("{0:yyyy/MM/dd}", newscheng.Rows[i]["nw_modifytime"]) + "</span></li>";
            }

            DataTable newsshi = new sql().GetNewsList(11);
            string strnewsshi = "";
            for (int i = 0; i < newsshi.Rows.Count; i++)
            {
                strnewsshi += "<li><span class='newstitle_new'><a target='_blank'";
                strnewsshi += " title='" + newsshi.Rows[i]["nw_title"].ToString() + "'";
                if ("1".Equals(newsshi.Rows[i]["nw_red"].ToString()))
                    strnewsshi += " style='color:Red'";
                if (!string.IsNullOrEmpty(newsshi.Rows[i]["nw_url"].ToString()))
                    strnewsshi += " href='" + newsshi.Rows[i]["nw_url"].ToString();
                else
                    strnewsshi += " href='News/" + newsshi.Rows[i]["nw_no"].ToString() + ".html";
                string title = newsshi.Rows[i]["nw_title"].ToString();
                if (title.Length > 30)
                    title = title.Substring(0, 28) + "...";
                strnewsshi += "'>" + title;
                if (Convert.ToInt32(newsshi.Rows[i]["dtime"].ToString()) <= 5)
                    strnewsshi += "</a>&nbsp;&nbsp;&nbsp;<img src='image/new.gif' style='width:22px;hight:9px;'/>";
                else
                    strnewsshi += "</a>";
                strnewsshi += "</span><span>";
                strnewsshi += string.Format("{0:yyyy/MM/dd}", newsshi.Rows[i]["nw_modifytime"]) + "</span></li>";
            }

            DataTable rendian = new sql().GetNewsList(12);
            string strredian = "";
            for (int i = 0; i < rendian.Rows.Count; i++)
            {
                strredian += "<li><span class='newstitle_new'><a target='_blank'";
                strredian += " title='" + rendian.Rows[i]["nw_title"].ToString() + "'";
                if ("1".Equals(rendian.Rows[i]["nw_red"].ToString()))
                    strredian += " style='color:Red'";
                if (!string.IsNullOrEmpty(rendian.Rows[i]["nw_url"].ToString()))
                    strredian += " href='" + rendian.Rows[i]["nw_url"].ToString();
                else
                    strredian += " href='News/" + rendian.Rows[i]["nw_no"].ToString() + ".html";
                string title = rendian.Rows[i]["nw_title"].ToString();
                if (title.Length > 30)
                    title = title.Substring(0, 28) + "...";
                strredian += "'>" + title;
                if (Convert.ToInt32(rendian.Rows[i]["dtime"].ToString()) <= 5)
                    strredian += "</a>&nbsp;&nbsp;&nbsp;<img src='image/new.gif' style='width:22px;hight:9px;'/>";
                else
                    strredian += "</a>";
                strredian += "</span><span>";
                strredian += string.Format("{0:yyyy/MM/dd}", rendian.Rows[i]["nw_modifytime"]) + "</span></li>";
            }

            DataTable zhaopinhui = new sql().GetJobfairList(1);
            string strzhaopinhui = "";
            for (int i = 0; i < zhaopinhui.Rows.Count; i++)
            {
                strzhaopinhui += "<li><div class='redian_xiao" + (i + 1) + "'></div>&nbsp;&nbsp;<a target='_blank' title='" + zhaopinhui.Rows[i]["jf_name"].ToString() + "' href='Jobfair/" + zhaopinhui.Rows[i]["jf_no"].ToString() + ".html'>";
                string title = zhaopinhui.Rows[i]["jf_name"].ToString();
                if (title.Length > 34)
                    title = title.Substring(0, 32) + "...";
                strzhaopinhui += title + "</a></li>";
            }

            DataTable zhouliujishi = new sql().GetJobfairList(2);
            string strzhouliujishi = "";
            for (int i = 0; i < zhouliujishi.Rows.Count; i++)
            {
                strzhouliujishi += "<li><div class='redian_xiao" + (i + 1) + "'></div>&nbsp;&nbsp;<a target='_blank' title='" + zhouliujishi.Rows[i]["jf_name"].ToString() + "' href='Jobfair/" + zhouliujishi.Rows[i]["jf_no"].ToString() + ".html'>";
                string title = zhouliujishi.Rows[i]["jf_name"].ToString();
                if (title.Length > 34)
                    title = title.Substring(0, 32) + "...";
                strzhouliujishi += title + "</a></li>";
            }

            DataTable vip = new sql().GetVipCompany();
            StringBuilder sbvip = new StringBuilder();
            string strvip = "";
            sbvip.Append("<ul>");
            for (int i = 0; i < vip.Rows.Count; i++)
            {
                sbvip.Append("<li>");
                sbvip.Append("<div class='zhiwei' onmouseout='dynamichide(event)' onmouseover='clearhidemenu()'></div>");
                if (!string.IsNullOrEmpty(vip.Rows[i]["color"].ToString()) && !"Default".Equals(vip.Rows[i]["color"].ToString()))
                    sbvip.Append("<a target='_blank' style='color:" + vip.Rows[i]["color"] + "' href='Company/" + vip.Rows[i]["cuno"] + ".html' onmouseover='popUp(this,event," + vip.Rows[i]["cuno"] + ")' onmouseout='delaypopDown()'>" + vip.Rows[i]["cuname"] + "</a>");
                else
                    sbvip.Append("<a target='_blank' href='Company/" + vip.Rows[i]["cuno"] + ".html' onmouseover='popUp(this,event," + vip.Rows[i]["cuno"] + ")' onmouseout='delaypopDown()'>" + vip.Rows[i]["cuname"] + "</a>");
                sbvip.Append("&nbsp;&nbsp;<a target='_blank' href='Job/" + vip.Rows[i]["reno1"] + ".html' title='" + vip.Rows[i]["rename1"] + "'><span>" + vip.Rows[i]["rename1"] + "</span></a>");
                if (!string.IsNullOrEmpty(vip.Rows[i]["reno2"].ToString()))
                    sbvip.Append("&nbsp;&nbsp;<a target='_blank' href='Job/" + vip.Rows[i]["reno2"] + ".html' title='" + vip.Rows[i]["rename2"] + "'><span>" + vip.Rows[i]["rename2"] + "</span></a>");
                sbvip.Append("</li>");
            }
            sbvip.Append("</ul>");
            strvip = sbvip.ToString();

            DataTable dtnew = new sql().GetNewCompany();
            StringBuilder sbnew = new StringBuilder();
            string strnew = "";
            sbnew.Append("<ul>");
            for (int i = 0; i < dtnew.Rows.Count; i++)
            {
                sbnew.Append("<li>");
                sbnew.Append("<div class='zhiwei' onmouseout='dynamichide(event)' onmouseover='clearhidemenu()'></div>");
                sbnew.Append("<a target='_blank' href='Company/" + dtnew.Rows[i]["cuno"] + ".html' onmouseover='popUp(this,event," + dtnew.Rows[i]["cuno"] + ")' onmouseout='delaypopDown()'>" + dtnew.Rows[i]["cuname"] + "</a>");
                sbnew.Append("</li>");
            }
            sbnew.Append("</ul>");
            strnew = sbnew.ToString();

            DataTable dttop = new sql().GetTopJob();
            StringBuilder sbtop = new StringBuilder();
            string strtop = "";
            sbtop.Append("<ul>");
            for (int i = 0; i < dttop.Rows.Count; i++)
            {
                sbtop.Append("<li>");
                sbtop.Append("<a target='_blank' href='Job/" + dttop.Rows[i]["re_no"] + ".html' title='" + dttop.Rows[i]["re_name"] + "'>");
                string title = dttop.Rows[i]["re_name"].ToString();
                if (title.Length > 14)
                    title = title.Substring(0, 12) + "...";
                sbtop.Append(title + "</a></li>");
            }
            sbtop.Append("</ul>");
            strtop = sbtop.ToString();
            //-----------------------增加高薪板块（月薪10000+）

            DataTable dtWellPay = new sql().GetWellPayJob();
            StringBuilder sbWellPay = new StringBuilder();
            string strWellPayJob = "";
            sbWellPay.Append("<ul>");
            for (int i = 0; i < dtWellPay.Rows.Count; i++)
            {
                sbWellPay.Append("<li>");
                sbWellPay.Append("<a target='_blank' href='Job/" + dtWellPay.Rows[i]["re_no"] + ".html' title='" + dtWellPay.Rows[i]["re_name"] + "'>");
                string title = dtWellPay.Rows[i]["re_name"].ToString();
                if (title.Length > 14)
                    title = title.Substring(0, 12) + "...";
                sbWellPay.Append(title + "</a></li>");
            }
            sbWellPay.Append("</ul>");
            strWellPayJob = sbWellPay.ToString();

            //-----------------------以上为高薪板块

            DataTable friendlink1 = new sql().GetFriendLink(1, 1);
            string strfriendlink1 = "";
            for (int i = 0; i < friendlink1.Rows.Count; i++)
            {
                strfriendlink1 += "<option value='" + friendlink1.Rows[i]["fl_url"].ToString() + "'>" + friendlink1.Rows[i]["fl_title"].ToString() + "</option>";
            }

            DataTable friendlink2 = new sql().GetFriendLink(1, 2);
            string strfriendlink2 = "";
            for (int i = 0; i < friendlink2.Rows.Count; i++)
            {
                strfriendlink2 += "<option value='" + friendlink2.Rows[i]["fl_url"].ToString() + "'>" + friendlink2.Rows[i]["fl_title"].ToString() + "</option>";
            }

            DataTable friendlink3 = new sql().GetFriendLink(1, 3);
            string strfriendlink3 = "";
            for (int i = 0; i < friendlink3.Rows.Count; i++)
            {
                strfriendlink3 += "<option value='" + friendlink3.Rows[i]["fl_url"].ToString() + "'>" + friendlink3.Rows[i]["fl_title"].ToString() + "</option>";
            }

            DataTable friendlink4 = new sql().GetFriendLink(1, 4);
            string strfriendlink4 = "";
            for (int i = 0; i < friendlink4.Rows.Count; i++)
            {
                strfriendlink4 += "<option value='" + friendlink4.Rows[i]["fl_url"].ToString() + "'>" + friendlink4.Rows[i]["fl_title"].ToString() + "</option>";
            }

            DataTable friendlink5 = new sql().GetFriendLink(1, 5);
            string strfriendlink5 = "";
            for (int i = 0; i < friendlink5.Rows.Count; i++)
            {
                strfriendlink5 += "<option value='" + friendlink5.Rows[i]["fl_url"].ToString() + "'>" + friendlink5.Rows[i]["fl_title"].ToString() + "</option>";
            }

            DataTable tupianxinwen = new sql().GetPictureNews(4);
            string strtupianxinwen = "";
            string strgundong = "";
            for (int i = 0; i < tupianxinwen.Rows.Count; i++)
            {
                if (i == 0)
                {
                    strgundong = "<li class='current' onmouseover='adchangea(1)'>1</li>";
                    strtupianxinwen += "<div class='show'><a target='_blank'";
                    if (!string.IsNullOrEmpty(tupianxinwen.Rows[i]["nw_url"].ToString()))
                        strtupianxinwen += " href='" + tupianxinwen.Rows[i]["nw_url"].ToString();
                    else
                        strtupianxinwen += " href='News/" + tupianxinwen.Rows[i]["nw_no"].ToString() + ".html";
                    strtupianxinwen += "'><img border='0' style='width:308px;height:225px;' src='" + tupianxinwen.Rows[i]["nw_img"].ToString() + "'/></a>";
                    strtupianxinwen += "<span>&nbsp;</span><p>";
                    string title = tupianxinwen.Rows[i]["nw_title"].ToString();
                    if (title.Length > 20)
                        title = title.Substring(0, 18) + "...";
                    strtupianxinwen += title + "</p></div>";
                }
                else
                {
                    strgundong += "<li onmouseover='adchangea(" + (i + 1) + ")'>" + (i + 1) + "</li>";
                    strtupianxinwen += "<div style='display: none;' class='hidden'><a target='_blank'";
                    if (!string.IsNullOrEmpty(tupianxinwen.Rows[i]["nw_url"].ToString()))
                        strtupianxinwen += " href='" + tupianxinwen.Rows[i]["nw_url"].ToString();
                    else
                        strtupianxinwen += " href='News/" + tupianxinwen.Rows[i]["nw_no"].ToString() + ".html";
                    strtupianxinwen += "'><img border='0' style='width:308px;height:225px;' src='" + tupianxinwen.Rows[i]["nw_img"].ToString() + "'/></a>";
                    strtupianxinwen += "<span>&nbsp;</span><p>";
                    string title = tupianxinwen.Rows[i]["nw_title"].ToString();
                    if (title.Length > 20)
                        title = title.Substring(0, 18) + "...";
                    strtupianxinwen += title + "</p></div>";
                }
            }

            DataTable video = new sql().GetVideoList();
            string strvideo = "";
            for (int i = 0; i < video.Rows.Count; i++)
            {
                if (i == 0)
                {
                    strvideo = "<div class='move_dv'>";
                    strvideo += "<div class='move_dv_top'>";
                    strvideo += "<div class='vip_top1'></div>";
                    strvideo += "<div class='clear'></div>";
                    strvideo += "<div class='vip_top2'>企业视频</div>";
                    strvideo += "</div>";
                    strvideo += "<div class='move_dv_con'>";
                    strvideo += "<div style='width:5px; height:180px; float:left;'></div>";
                    strvideo += "<div id='demovideo' style='overflow:hidden;height:180px;width:968px; float:left;'>";
                    strvideo += "<table width='968' cellspacing='0' cellpadding='0' border='0'>";
                    strvideo += "<tr>";
                    strvideo += "<td id='demovideo1'>";
                    strvideo += "<table width='968' cellspacing='0' cellpadding='0' border='0'>";
                    strvideo += "<tr>";
                }

                strvideo += "<td width='160' align='center'>";
                strvideo += "<table width='160' cellspacing='0' cellpadding='0' border='0'>";
                strvideo += "<tr>";
                strvideo += "<td width='160' height='137'>";
                strvideo += "<table width='160' cellspacing='0' cellpadding='0' border='0'>";
                strvideo += "<tr>";
                strvideo += "<td align='center'>";
                strvideo += "<object width='160' height='120' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'>";
                strvideo += "<param value='/upload/flash/flv.swf?vcastr_file=" + video.Rows[i]["uv_video"] + "&IsAutoPlay=0' name='movie'/>";
                strvideo += "<param value='high' name='quality'/>";
                strvideo += "<param value='true' name='allowFullScreen'/>";
                strvideo += "<param value='transparent' name='wmode'/>";
                strvideo += "<embed width='160' height='120' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' quality='high' allowfullscreen='true' src='/upload/flash/flv.swf?vcastr_file=" + video.Rows[i]["uv_video"] + "&IsAutoPlay=1'>";
                strvideo += "</object>";
                strvideo += "</td>";
                strvideo += "</tr>";
                strvideo += "<tr>";
                strvideo += "<td height='17' align='center'>";
                strvideo += video.Rows[i]["uv_title"].ToString();
                strvideo += "</td>";
                strvideo += "</tr>";
                strvideo += "</table>";
                strvideo += "</td>";
                strvideo += "<td width='10' height='180'>&nbsp;</td>";
                strvideo += "</tr>";
                strvideo += "</table>";
                strvideo += "</td>";

                if (i == video.Rows.Count -1)
                {
                    strvideo += "</tr>";
                    strvideo += "</table>";
                    strvideo += "</td>";
                    strvideo += "<td id='demovideo2'></td>";
                    strvideo += "</tr>";
                    strvideo += "</table>";
                    strvideo += "</div>";
                    strvideo += "<div style='width:5px; height:180px; float:left;'></div>";
                    strvideo += "<script language='javascript' type='text/javascript'>";
                    strvideo += "var videospeed = 35;";
                    strvideo += "document.getElementById('demovideo2').innerHTML = document.getElementById('demovideo1').innerHTML";
                    strvideo += "function MarqueeVideo() {";
                    strvideo += "if (document.getElementById('demovideo2').offsetWidth - document.getElementById('demovideo').scrollLeft <= 0) ";
                    strvideo += "document.getElementById('demovideo').scrollLeft -= document.getElementById('demovideo1').offsetWidth;";
                    strvideo += " else ";
                    strvideo += "document.getElementById('demovideo').scrollLeft++;}";
                    strvideo += "var MyVideoMar = setInterval(MarqueeVideo, videospeed);";
                    strvideo += "document.getElementById('demovideo').onmouseover = function () {clearInterval(MyVideoMar);}";
                    strvideo += "document.getElementById('demovideo').onmouseout = function () {MyVideoMar = setInterval(MarqueeVideo, videospeed);}";
                    strvideo += "</script>";
                    strvideo += "</div>";
                    strvideo += "</div>";
                }
            }

            string mbPath = Server.MapPath("/upload/html/Index.html");
            Encoding code = Encoding.GetEncoding("utf-8");
            StreamReader sr = null;
            StreamWriter sw = null;
            string str = null;

            int ret = 0;

            //读取
            try
            {
                sr = new StreamReader(mbPath, code);
                str = sr.ReadToEnd();
            }
            catch (Exception ex)
            {
                ret = -1;
            }
            finally
            {
                sr.Close();
            }

            str = str.Replace("$advertisement1$", strad1);

            str = str.Replace("$tupianxinwen$", strtupianxinwen);
            str = str.Replace("$gundong$", strgundong);

            str = str.Replace("$advertisement2$", strad2);

            str = str.Replace("$advertisement3$", strad3);

            str = str.Replace("$advertisement4$", strad4);

            str = str.Replace("$advertisement5$", strad5);
            str = str.Replace("$advertisement6$", strad6);

            str = str.Replace("$advertisement7$", strad7);

            str = str.Replace("$newsxin$", strnewsxin);
            str = str.Replace("$newstong$", strnewstong);
            str = str.Replace("$newscheng$", strnewscheng);
            str = str.Replace("$newsshi$", strnewsshi);
            str = str.Replace("$redian$", strredian);

            str = str.Replace("$zhaopinhui$", strzhaopinhui);
            str = str.Replace("$zhouliujishi$", strzhouliujishi);

            str = str.Replace("$vipcom$", strvip);
            str = str.Replace("$topjob$", strtop);
            str = str.Replace("$wellPayJob$", strWellPayJob); 
            str = str.Replace("$newcom$", strnew);

            str = str.Replace("$video$", strvideo);

            str = str.Replace("$friendlink1$", strfriendlink1);
            str = str.Replace("$friendlink2$", strfriendlink2);
            str = str.Replace("$friendlink3$", strfriendlink3);
            str = str.Replace("$friendlink4$", strfriendlink4);
            str = str.Replace("$friendlink5$", strfriendlink5);

            //生成静态文件
            try
            {
                sw = new StreamWriter(Server.MapPath("/Web/Index.html"), false, code);
                sw.Write(str);
                sw.Flush();
            }
            catch (Exception ex)
            {
                ret = -1;
            }
            finally
            {
                sw.Close();
            }
            if (ret != -1)
            {
                new sql().UpdateCreatTime(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress);
                Response.Write(1);
            }
            else
                Response.Write(-1);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 未处理事项
    /// </summary>
    public void GetWaitList()
    {
        try
        {
            Int64 count1 = new sql().GetCompanyCount();
            Int64 count2 = new sql().GetRecruitCount();
            Int64 count3 = new sql().GetPersonCount();
            Int64 count4 = new sql().GetAdCount();

            ArrayList list = new ArrayList();
            Hashtable data = new Hashtable();
            data["type"] = "未审核企业";
            data["num"] = count1;
            list.Add(data);

            data = new Hashtable();
            data["type"] = "未审核岗位";
            data["num"] = count2;
            list.Add(data);

            data = new Hashtable();
            data["type"] = "未审核人才";
            data["num"] = count3;
            list.Add(data);

            data = new Hashtable();
            data["type"] = "过期广告";
            data["num"] = count4;
            list.Add(data);

            string json = JSON.Encode(list);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 党员之家首页信息
    /// </summary>
    public void GetPartyNewsList()
    {
        try
        {
            ArrayList data = new sql().GetPartyNewsList();
            string json = JSON.Encode(data);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 党员之家首页生成
    /// </summary>
    public void CreatePartyHtml()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "76");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            DataTable ad1 = new sql().GetParty9List(43);
            string strad1 = "";
            for (int i = 0; i < ad1.Rows.Count; i++)
            {
                if (string.IsNullOrEmpty(ad1.Rows[0]["nw_url"].ToString()))
                    strad1 += "<li><a target='_blank' href='" + ad1.Rows[i]["nw_no"].ToString() + ".html'";
                else
                    strad1 += "<li><a target='_blank' href='" + ad1.Rows[i]["nw_url"].ToString() + "'";
                strad1 += " title='" + ad1.Rows[i]["nw_title"].ToString() + "'>";
                if (ad1.Rows[i]["nw_title"].ToString().Length > 17)
                    strad1 += ad1.Rows[i]["nw_title"].ToString().Substring(0, 15) + "...</a></li>";
                else
                    strad1 += ad1.Rows[i]["nw_title"].ToString() + "</a></li>";
            }

            DataTable ad2 = new sql().GetParty9List(42);
            string strad2 = "";
            for (int i = 0; i < ad2.Rows.Count; i++)
            {
                if (string.IsNullOrEmpty(ad2.Rows[0]["nw_url"].ToString()))
                    strad2 += "<li><span class='qktb_con_news'><a target='_blank' href='" + ad2.Rows[i]["nw_no"].ToString() + ".html'";
                else
                    strad2 += "<li><span class='qktb_con_news'><a target='_blank' href='" + ad2.Rows[i]["nw_url"].ToString() + "'";
                strad2 += " title='" + ad2.Rows[i]["nw_title"].ToString() + "'>";
                if (ad2.Rows[i]["nw_title"].ToString().Length > 27)
                    strad2 += ad2.Rows[i]["nw_title"].ToString().Substring(0, 25) + "...</a></span>";
                else
                    strad2 += ad2.Rows[i]["nw_title"].ToString() + "</a></span>";
                strad2 += "<span class='qktb_con_time'>" + string.Format("{0:s}", ad2.Rows[i]["nw_inserttime"]).Substring(0, 10) + "</span></li>";
            }

            DataTable ad3 = new sql().GetParty7List(45);
            string strad3 = "";
            for (int i = 0; i < ad3.Rows.Count; i++)
            {
                if (string.IsNullOrEmpty(ad3.Rows[i]["nw_url"].ToString()))
                    strad3 += "<li><a target='_blank' href='" + ad3.Rows[i]["nw_no"].ToString() + ".html'";
                else
                    strad3 += "<li><a target='_blank' href='" + ad3.Rows[i]["nw_url"].ToString() + "'";
                strad3 += " title='" + ad3.Rows[i]["nw_title"].ToString() + "'>";
                if (ad3.Rows[i]["nw_title"].ToString().Length > 29)
                    strad3 += ad3.Rows[i]["nw_title"].ToString().Substring(0, 27) + "...</a></li>";
                else
                    strad3 += ad3.Rows[i]["nw_title"].ToString() + "</a></li>";
            }

            DataTable ad4 = new sql().GetParty7List(46);
            string strad4 = "";
            for (int i = 0; i < ad4.Rows.Count; i++)
            {
                if (string.IsNullOrEmpty(ad4.Rows[i]["nw_url"].ToString()))
                    strad4 += "<li><a target='_blank' href='" + ad4.Rows[i]["nw_no"].ToString() + ".html'";
                else
                    strad4 += "<li><a target='_blank' href='" + ad4.Rows[i]["nw_url"].ToString() + "'";
                strad4 += " title='" + ad4.Rows[i]["nw_title"].ToString() + "'>";
                if (ad4.Rows[i]["nw_title"].ToString().Length > 29)
                    strad4 += ad4.Rows[i]["nw_title"].ToString().Substring(0, 27) + "...</a></li>";
                else
                    strad4 += ad4.Rows[i]["nw_title"].ToString() + "</a></li>";
            }

            DataTable friendlink = new sql().GetFriendLink(2);
            string strfriendlink = "";
            for (int i = 0; i < friendlink.Rows.Count; i++)
            {
                strfriendlink += "<div class='ggjj'><a target='_blank' href='" + friendlink.Rows[i]["fl_url"].ToString() + "'><img style='width:180px;height:40px;' src='" + friendlink.Rows[i]["fl_pic"].ToString() + "'></a></div>";
            }

            DataTable ad5 = new sql().GetParty7List(47);
            string strad5 = "";
            if(ad5.Rows.Count> 4)
            {
                strad5 += "<div id='demo' style='overflow:hidden;height:180px;width:733px; float:left;'>";
                strad5 += "<table width='733' cellspacing='0' cellpadding='0' border='0'>";
                strad5 += "<tr>";
                strad5 += "<td id='demo1'>";
            }
            if (ad5.Rows.Count > 0)
            {
                strad5 += "<table width='733' cellspacing='0' cellpadding='0' border='0'>";
                strad5 += "<tr>";
            }
            for (int i = 0; i < ad5.Rows.Count; i++)
            {
                strad5 += "<td width='160' align='center'>";
                strad5 += "<table width='160' cellspacing='0' cellpadding='0' border='0'>";
                strad5 += "<tr>";
                strad5 += "<td width='160' height='137'>";
                strad5 += "<table width='160' cellspacing='0' cellpadding='0' border='0'>";
                strad5 += "<tr>";
                strad5 += "<td align='center'>";
                if (string.IsNullOrEmpty(ad5.Rows[0]["nw_url"].ToString()))
                    strad5 += "<a target='_blank' href='" + ad5.Rows[i]["nw_no"].ToString() + ".html'>";
                else
                    strad5 += "<a target='_blank' href='" + ad5.Rows[i]["nw_url"].ToString() + "'>";
                strad5 += "<img border='0' style='width:160px;height:120px;' src='" + ad5.Rows[i]["nw_img"].ToString() + "'/></a>";
                strad5 += "</td>";
                strad5 += "</tr>";
                strad5 += "<tr>";
                strad5 += "<td height='17' align='center'>";
                if (string.IsNullOrEmpty(ad5.Rows[i]["nw_url"].ToString()))
                    strad5 += "<a target='_blank' href='" + ad5.Rows[i]["nw_no"].ToString() + ".html'";
                else
                    strad5 += "<a target='_blank' href='" + ad5.Rows[i]["nw_url"].ToString() + "'";
                strad5 += " title='" + ad5.Rows[i]["nw_title"].ToString() + "'>";
                if (ad5.Rows[i]["nw_title"].ToString().Length > 12)
                    strad5 += ad5.Rows[i]["nw_title"].ToString().Substring(0, 10) + "...</a></td>";
                else
                    strad5 += ad5.Rows[i]["nw_title"].ToString() + "</a></td>";
                strad5 += "</tr>";
                strad5 += "</table>";
                strad5 += "</td>";
                strad5 += "<td width='10' height='180'>&nbsp;</td>";
                strad5 += "</tr>";
                strad5 += "</table>";
                strad5 += "</td>";
            }
            if (ad5.Rows.Count > 0)
            {
                strad5 += "</tr>";
                strad5 += "</table>";
            }
            if(ad5.Rows.Count> 4)
            {
                strad5 += "</td>";
                strad5 += "<td id='demo2'></td>";
                strad5 += "</tr>";
                strad5 += "</table>";
                strad5 += "</div>";
            }

            DataTable ad6 = new sql().GetPartyPic4List(42);
            string strad6 = "";
            string strgundong = "";
            for (int i = 0; i < ad6.Rows.Count; i++)
            {
                if (i == 0)
                {
                    strgundong += "<li class='current' onmouseover='adchangea(1)'>1</li>";
                    strad6 += "<div class='show'>";
                }
                else
                {
                    strgundong += "<li onmouseover='adchangea(" + (i + 1) + ")'>" + (i + 1) + "</li>";
                    strad6 += "<div style='display: none;' class='hidden'>";
                }
                if (string.IsNullOrEmpty(ad6.Rows[i]["nw_url"].ToString()))
                    strad6 += "<a target='_blank' href='" + ad6.Rows[i]["nw_no"].ToString() + ".html'>";
                else
                    strad6 += "<a target='_blank' href='" + ad6.Rows[i]["nw_url"].ToString() + "'>";
                strad6 += "<img border='0' style='width:270px;height:217px;' src='" + ad6.Rows[i]["nw_img"].ToString() + "'/></a><span>&nbsp;</span><p>";
                if (ad6.Rows[i]["nw_title"].ToString().Length > 20)
                    strad6 += ad6.Rows[i]["nw_title"].ToString().Substring(0, 20) + "...</p></div>";
                else
                    strad6 += ad6.Rows[i]["nw_title"].ToString() + "</p></div>";
            }

            string mbPath = Server.MapPath("/upload/html/Party.html");
            Encoding code = Encoding.GetEncoding("utf-8");
            StreamReader sr = null;
            StreamWriter sw = null;
            string str = null;

            int ret = 0;

            //读取
            try
            {
                sr = new StreamReader(mbPath, code);
                str = sr.ReadToEnd();
            }
            catch (Exception ex)
            {
                ret = -1;
            }
            finally
            {
                sr.Close();
            }

            str = str.Replace("$szkd$", strad1);
            str = str.Replace("$qktb$", strad2);
            str = str.Replace("$xxyd$", strad3);
            str = str.Replace("$dyfc$", strad4);
            str = str.Replace("$yqlj$", strfriendlink);
            str = str.Replace("$zbhd$", strad5);
            str = str.Replace("$lbtp$", strad6);
            str = str.Replace("$lbtp2$", strgundong);
            //生成静态文件
            try
            {
                sw = new StreamWriter(Server.MapPath("../../Web/Party/Index.html"), false, code);
                sw.Write(str);
                sw.Flush();
            }
            catch (Exception ex)
            {
                ret = -1;
            }
            finally
            {
                sw.Close();
            }
            if (ret != -1)
            {
                Response.Write(1);
            }
            else
                Response.Write(-1);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// HR首页信息
    /// </summary>
    public void GetHRNewsList()
    {
        try
        {
            ArrayList data = new sql().GetHRNewsList();
            string json = JSON.Encode(data);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// HR首页生成
    /// </summary>
    public void CreateHRHtml()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1001,1002,1003,1004,1005,1006");
            if (!flg)
            {
                Response.Write("no");
                return;
            }

            //DataTable ad = new sql().GetAdList(1);
            //string strad = "";
            //if (ad != null && ad.Rows.Count > 0)
            //{
            //    strad = "<a target='_blank' href='" + ad.Rows[0]["ad_url"].ToString() + "'><img style='width:760px;height:70px;' src='" + ad.Rows[0]["ad_img"].ToString() + "' /></a>";
            //}

            DataTable ad1 = new sql().GetHR9List(76);
            string strad1 = "";
            for (int i = 0; i < ad1.Rows.Count; i++)
            {
                if (string.IsNullOrEmpty(ad1.Rows[0]["nw_url"].ToString()))
                    strad1 += "<li><span class='hr_tzgg_news'><a target='_blank' href='" + ad1.Rows[i]["nw_no"].ToString() + ".html'";
                else
                    strad1 += "<li><span class='hr_tzgg_news'><a target='_blank' href='" + ad1.Rows[i]["nw_url"].ToString() + "'";
                strad1 += " title='" + ad1.Rows[i]["nw_title"].ToString() + "'>";
                if (ad1.Rows[i]["nw_title"].ToString().Length > 35)
                    strad1 += ad1.Rows[i]["nw_title"].ToString().Substring(0, 33) + "...</a></span>";
                else
                    strad1 += ad1.Rows[i]["nw_title"].ToString() + "</a></span>";
                strad1 += "<span class='hr_jyjl_time'>" + string.Format("{0:s}", ad1.Rows[i]["nw_inserttime"]).Substring(0, 10) + "</span></li>";
            }

            DataTable ad2 = new sql().GetHR7List(77);
            string strad2 = "";
            for (int i = 0; i < ad2.Rows.Count; i++)
            {
                if (string.IsNullOrEmpty(ad2.Rows[0]["nw_url"].ToString()))
                    strad2 += "<li><a target='_blank' href='" + ad2.Rows[i]["nw_no"].ToString() + ".html'";
                else
                    strad2 += "<li><a target='_blank' href='" + ad2.Rows[i]["nw_url"].ToString() + "'";
                strad2 += " title='" + ad2.Rows[i]["nw_title"].ToString() + "'>";
                if (ad2.Rows[i]["nw_title"].ToString().Length > 19)
                    strad2 += ad2.Rows[i]["nw_title"].ToString().Substring(0, 17) + "...</a></li>";
                else
                    strad2 += ad2.Rows[i]["nw_title"].ToString() + "</a></li>";
            }

            DataTable ad3 = new sql().GetHR7List(78);
            string strad3 = "";
            for (int i = 0; i < ad3.Rows.Count; i++)
            {
                if (string.IsNullOrEmpty(ad3.Rows[i]["nw_url"].ToString()))
                    strad3 += "<li><span class='hr_jyjl_news'><a target='_blank' href='" + ad3.Rows[i]["nw_no"].ToString() + ".html'";
                else
                    strad3 += "<li><span class='hr_jyjl_news'><a target='_blank' href='" + ad3.Rows[i]["nw_url"].ToString() + "'";
                strad3 += " title='" + ad3.Rows[i]["nw_title"].ToString() + "'>";
                if (ad3.Rows[i]["nw_title"].ToString().Length > 20)
                    strad3 += ad3.Rows[i]["nw_title"].ToString().Substring(0, 18) + "...</a></span>";
                else
                    strad3 += ad3.Rows[i]["nw_title"].ToString() + "</a></span>";
                strad3 += "<span class='hr_jyjl_time'>[" + string.Format("{0:MM-dd}", ad3.Rows[i]["nw_inserttime"]) + "]</span></li>";
            }

            DataTable xhzl1 = new sql().GetHRXHZLList(71);
            DataTable xhzl2 = new sql().GetHRXHZLList(72);
            DataTable xhzl3 = new sql().GetHRXHZLList(73);
            DataTable xhzl4 = new sql().GetHRXHZLList(74);
            DataTable xhzl5 = new sql().GetHRXHZLList(75);
            DataTable xhzl6 = new sql().GetHRXHZLList(79);
            DataTable xhzl7 = new sql().GetHRXHZLList(710);
            string strxhzl = "";
            if (xhzl1.Rows.Count > 0)
            {
                if (string.IsNullOrEmpty(xhzl1.Rows[0]["nw_url"].ToString()))
                    strxhzl += "<div class='xhzl_bg1'><img src='../image/hr/hr_logo1.jpg' class='xhlogo' /><a href='" + xhzl1.Rows[0]["nw_no"].ToString() + ".html'>协会简介</a></div>";
                else
                    strxhzl += "<div class='xhzl_bg1'><img src='../image/hr/hr_logo1.jpg' class='xhlogo' /><a href='" + xhzl1.Rows[0]["nw_url"].ToString() + "'>协会简介</a></div>";
            }
            else
                strxhzl += "<div class='xhzl_bg1'><img src='../image/hr/hr_logo1.jpg' class='xhlogo' /><a href='#'>协会简介</a></div>";
            if (xhzl2.Rows.Count > 0)
            {
                if (string.IsNullOrEmpty(xhzl2.Rows[0]["nw_url"].ToString()))
                    strxhzl += "<div class='xhzl_bg2'><img src='../image/hr/hr_logo3.jpg' class='xhlogo' /><a href='" + xhzl2.Rows[0]["nw_no"].ToString() + ".html'>入会申请</a></div>";
                else
                    strxhzl += "<div class='xhzl_bg2'><img src='../image/hr/hr_logo3.jpg' class='xhlogo' /><a href='" + xhzl2.Rows[0]["nw_url"].ToString() + "'>入会申请</a></div>";
            }
            else
                strxhzl += "<div class='xhzl_bg2'><img src='../image/hr/hr_logo3.jpg' class='xhlogo' /><a href='#'>入会申请</a></div>";
            if (xhzl3.Rows.Count > 0)
            {
                if (string.IsNullOrEmpty(xhzl2.Rows[0]["nw_url"].ToString()))
                    strxhzl += "<div class='xhzl_bg1'><img src='../image/hr/hr_logo4.jpg' class='xhlogo' /><a href='" + xhzl3.Rows[0]["nw_no"].ToString() + ".html'>协会章程</a></div>";
                else
                    strxhzl += "<div class='xhzl_bg1'><img src='../image/hr/hr_logo4.jpg' class='xhlogo' /><a href='" + xhzl3.Rows[0]["nw_url"].ToString() + "'>协会章程</a></div>";
            }
            else
                strxhzl += "<div class='xhzl_bg1'><img src='../image/hr/hr_logo4.jpg' class='xhlogo' /><a href='#'>协会章程</a></div>";
            if (xhzl4.Rows.Count > 0)
            {
                if (string.IsNullOrEmpty(xhzl4.Rows[0]["nw_url"].ToString()))
                    strxhzl += "<div class='xhzl_bg2'><img src='../image/hr/hr_logo5.jpg' class='xhlogo' /><a href='" + xhzl4.Rows[0]["nw_no"].ToString() + ".html'>选举办法</a></div>";
                else
                    strxhzl += "<div class='xhzl_bg2'><img src='../image/hr/hr_logo5.jpg' class='xhlogo' /><a href='" + xhzl4.Rows[0]["nw_url"].ToString() + "'>选举办法</a></div>";
            }
            else
                strxhzl += "<div class='xhzl_bg2'><img src='../image/hr/hr_logo5.jpg' class='xhlogo' /><a href='#'>选举办法</a></div>";
            if (xhzl5.Rows.Count > 0)
            {
                if (string.IsNullOrEmpty(xhzl5.Rows[0]["nw_url"].ToString()))
                    strxhzl += "<div class='xhzl_bg1'><img src='../image/hr/hr_logo1.jpg' class='xhlogo' /><a href='" + xhzl5.Rows[0]["nw_no"].ToString() + ".html'>组织结构</a></div>";
                else
                    strxhzl += "<div class='xhzl_bg1'><img src='../image/hr/hr_logo1.jpg' class='xhlogo' /><a href='" + xhzl5.Rows[0]["nw_url"].ToString() + "'>组织结构</a></div>";
            }
            else
                strxhzl += "<div class='xhzl_bg1'><img src='../image/hr/hr_logo1.jpg' class='xhlogo' /><a href='#'>组织结构</a></div>";
            if (xhzl6.Rows.Count > 0)
            {
                if (string.IsNullOrEmpty(xhzl6.Rows[0]["nw_url"].ToString()))
                    strxhzl += "<div class='xhzl_bg2'><img src='../image/hr/hr_logo6.jpg' class='xhlogo' /><a href='" + xhzl6.Rows[0]["nw_no"].ToString() + ".html'>常务理事名单</a></div>";
                else
                    strxhzl += "<div class='xhzl_bg2'><img src='../image/hr/hr_logo6.jpg' class='xhlogo' /><a href='" + xhzl6.Rows[0]["nw_url"].ToString() + "'>常务理事名单</a></div>";
            }
            else
                strxhzl += "<div class='xhzl_bg2'><img src='../image/hr/hr_logo6.jpg' class='xhlogo' /><a href='#'>常务理事名单</a></div>";
            strxhzl += "<div class='xhzl_bg1'><img src='../image/hr/hr_logo2.jpg' class='xhlogo' /><a href='Member.html'>会员名单</a></div>";
            if (xhzl7.Rows.Count > 0)
            {
                if (string.IsNullOrEmpty(xhzl7.Rows[0]["nw_url"].ToString()))
                    strxhzl += "<div class='xhzl_bg2'><img src='../image/hr/hr_logo7.jpg' class='xhlogo' /><a href='" + xhzl7.Rows[0]["nw_no"].ToString() + ".html'>财务管理和会费缴纳办法</a></div>";
                else
                    strxhzl += "<div class='xhzl_bg2'><img src='../image/hr/hr_logo7.jpg' class='xhlogo' /><a href='" + xhzl7.Rows[0]["nw_url"].ToString() + "'>财务管理和会费缴纳办法</a></div>";
            }
            else
                strxhzl += "<div class='xhzl_bg2'><img src='../image/hr/hr_logo7.jpg' class='xhlogo' /><a href='#'>财务管理和会费缴纳办法</a></div>";

            DataTable zdqy = new sql().GetAdList(0);
            string strzdqy = "";
            for (int i = 0; i < zdqy.Rows.Count; i++)
            {
                strzdqy += "<li><a target='_blank' href='" + zdqy.Rows[i]["ad_url"].ToString() + "'><img style='width:150px;height:40px;' src='" + zdqy.Rows[i]["ad_img"].ToString() + "'></a></li>";
            }

            DataTable yqlj = new sql().GetFriendLink(4);
            string stryqlj = "";
            for (int i = 0; i < yqlj.Rows.Count; i++)
            {
                stryqlj += "<li><a target='_blank' href='" + yqlj.Rows[i]["fl_url"].ToString() + "'>" + yqlj.Rows[i]["fl_title"].ToString() + "</a></li>";
            }

            DataTable ad6 = new sql().GetHRPic4List(70);
            string strad6 = "";
            for (int i = 0; i < ad6.Rows.Count; i++)
            {
                if (i == 0)
                    strad6 += "<div class='show'>";
                else
                    strad6 += "<div style='display: none;' class='hidden'>";
                if (string.IsNullOrEmpty(ad6.Rows[i]["nw_url"].ToString()))
                    strad6 += "<a target='_blank' href='" + ad6.Rows[i]["nw_no"].ToString() + ".html'>";
                else
                    strad6 += "<a target='_blank' href='" + ad6.Rows[i]["nw_url"].ToString() + "'>";
                strad6 += "<img border='0' src='" + ad6.Rows[i]["nw_img"].ToString() + "'/></a><span>&nbsp;</span><p>";
                if (ad6.Rows[i]["nw_title"].ToString().Length > 28)
                    strad6 += ad6.Rows[i]["nw_title"].ToString().Substring(0, 26) + "...</p></div>";
                else
                    strad6 += ad6.Rows[i]["nw_title"].ToString() + "</p></div>";
            }

            string mbPath = Server.MapPath("/upload/html/HR.html");
            Encoding code = Encoding.GetEncoding("utf-8");
            StreamReader sr = null;
            StreamWriter sw = null;
            string str = null;

            int ret = 0;

            //读取
            try
            {
                sr = new StreamReader(mbPath, code);
                str = sr.ReadToEnd();
            }
            catch (Exception ex)
            {
                ret = -1;
            }
            finally
            {
                sr.Close();
            }

            //str = str.Replace("$advertisement1$", strad);
            str = str.Replace("$lbtp$", strad6);
            str = str.Replace("$tzgg$", strad1);
            str = str.Replace("$xhdt$", strad2);
            str = str.Replace("$jyjl$", strad3);
            str = str.Replace("$xhzl$", strxhzl);
            str = str.Replace("$zdqy$", strzdqy);
            str = str.Replace("$yqlj$", stryqlj);
            //生成静态文件
            try
            {
                sw = new StreamWriter(Server.MapPath("../../Web/HR/Index.html"), false, code);
                sw.Write(str);
                sw.Flush();
            }
            catch (Exception ex)
            {
                ret = -1;
            }
            finally
            {
                sw.Close();
            }
            if (ret != -1)
            {
                Response.Write(1);
            }
            else
                Response.Write(-1);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 高层次人才首页信息
    /// </summary>
    public void GetHighNewsList()
    {
        try
        {
            ArrayList data = new sql().GetHighNewsList();
            string json = JSON.Encode(data);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 高层次人才首页生成
    /// </summary>
    public void CreateHighHtml()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1104");
            if (!flg)
            {
                Response.Write("no");
                return;
            }

            DataTable lbtp = new sql().GetHighTpList(82);
            string strlbtp = "";
            for (int i = 0; i < lbtp.Rows.Count; i++)
            {
                if (i == 0)
                    strlbtp += "<div class='show'>";
                else
                    strlbtp += "<div style='display: none;' class='hidden'>";
                if (string.IsNullOrEmpty(lbtp.Rows[i]["nw_url"].ToString()))
                    strlbtp += "<a target='_blank' href='" + lbtp.Rows[i]["nw_no"].ToString() + ".html'>";
                else
                    strlbtp += "<a target='_blank' href='" + lbtp.Rows[i]["nw_url"].ToString() + "'>";
                strlbtp += "<img border='0' style='width:305px;height:220px;' src='" + lbtp.Rows[i]["nw_img"].ToString() + "'/></a><span>&nbsp;</span><p>";
                if (lbtp.Rows[i]["nw_title"].ToString().Length > 16)
                    strlbtp += lbtp.Rows[i]["nw_title"].ToString().Substring(0, 14) + "...</p></div>";
                else
                    strlbtp += lbtp.Rows[i]["nw_title"].ToString() + "</p></div>";
            }

            DataTable gzdt = new sql().GetHigh10List(82);
            string strgzdt = "";
            for (int i = 0; i < gzdt.Rows.Count; i++)
            {
                if (string.IsNullOrEmpty(gzdt.Rows[0]["nw_url"].ToString()))
                    strgzdt += "<li><a target='_blank' href='" + gzdt.Rows[i]["nw_no"].ToString() + ".html'";
                else
                    strgzdt += "<li><a target='_blank' href='" + gzdt.Rows[i]["nw_url"].ToString() + "'";
                strgzdt += " title='" + gzdt.Rows[i]["nw_title"].ToString() + "'>";
                if (gzdt.Rows[i]["nw_title"].ToString().Length > 28)
                    strgzdt += gzdt.Rows[i]["nw_title"].ToString().Substring(0, 26) + "...</a></li>";
                else
                    strgzdt += gzdt.Rows[i]["nw_title"].ToString() + "</a></li>";
            }

            DataTable zcwj = new sql().GetHigh6List(83);
            string strzcwj = "";
            for (int i = 0; i < zcwj.Rows.Count; i++)
            {
                if (string.IsNullOrEmpty(zcwj.Rows[i]["nw_url"].ToString()))
                    strzcwj += "<li><a target='_blank' href='" + zcwj.Rows[i]["nw_no"].ToString() + ".html'";
                else
                    strzcwj += "<li><span class='hr_jyjl_news'><a target='_blank' href='" + zcwj.Rows[i]["nw_url"].ToString() + "'";
                strzcwj += " title='" + zcwj.Rows[i]["nw_title"].ToString() + "'>";
                if (zcwj.Rows[i]["nw_title"].ToString().Length > 26)
                    strzcwj += zcwj.Rows[i]["nw_title"].ToString().Substring(0, 24) + "...</a></li>";
                else
                    strzcwj += zcwj.Rows[i]["nw_title"].ToString() + "</a></li>";
            }

            DataTable cypt = new sql().GetHigh6List(84);
            string strcypt = "";
            for (int i = 0; i < cypt.Rows.Count; i++)
            {
                if (string.IsNullOrEmpty(cypt.Rows[i]["nw_url"].ToString()))
                    strcypt += "<li><a target='_blank' href='" + cypt.Rows[i]["nw_no"].ToString() + ".html'";
                else
                    strcypt += "<li><span class='hr_jyjl_news'><a target='_blank' href='" + cypt.Rows[i]["nw_url"].ToString() + "'";
                strcypt += " title='" + cypt.Rows[i]["nw_title"].ToString() + "'>";
                if (cypt.Rows[i]["nw_title"].ToString().Length > 26)
                    strcypt += cypt.Rows[i]["nw_title"].ToString().Substring(0, 24) + "...</a></li>";
                else
                    strcypt += cypt.Rows[i]["nw_title"].ToString() + "</a></li>";
            }

            DataTable rcxq = new sql().GetHigh6List(85);
            string strrcxq = "";
            for (int i = 0; i < rcxq.Rows.Count; i++)
            {
                if (string.IsNullOrEmpty(rcxq.Rows[i]["nw_url"].ToString()))
                    strrcxq += "<li><a target='_blank' href='" + rcxq.Rows[i]["nw_no"].ToString() + ".html'";
                else
                    strrcxq += "<li><span class='hr_jyjl_news'><a target='_blank' href='" + rcxq.Rows[i]["nw_url"].ToString() + "'";
                strrcxq += " title='" + rcxq.Rows[i]["nw_title"].ToString() + "'>";
                if (rcxq.Rows[i]["nw_title"].ToString().Length > 26)
                    strrcxq += rcxq.Rows[i]["nw_title"].ToString().Substring(0, 24) + "...</a></li>";
                else
                    strrcxq += rcxq.Rows[i]["nw_title"].ToString() + "</a></li>";
            }

            DataTable wtjd = new sql().GetHighConsultList(9);
            string strwtjd = "";
            for (int i = 0; i < wtjd.Rows.Count; i++)
            {
                strwtjd += "<li><img src='../image/talent/rc_logo6.gif' style='vertical-align:middle; padding-left:10px;' />&nbsp;&nbsp;";
                if (wtjd.Rows[i]["cs_content"].ToString().Length > 26)
                    strwtjd += wtjd.Rows[i]["cs_content"].ToString().Substring(0, 24) + ".../li>";
                else
                    strwtjd += wtjd.Rows[i]["cs_content"].ToString() + "</li>";
                strwtjd += "<li style='background-color:#fdfeee; border-top:dotted 1px #fdd0a7; border-bottom:dotted 1px #fdd0a7;'><img src='../image/talent/rc_logo8.gif' style='vertical-align:middle; padding-left:10px;' />&nbsp;&nbsp;";
                if (wtjd.Rows[i]["cs_hfcontent"].ToString().Length > 26)
                    strwtjd += wtjd.Rows[i]["cs_hfcontent"].ToString().Substring(0, 24) + ".../li>";
                else
                    strwtjd += wtjd.Rows[i]["cs_hfcontent"].ToString() + "</li>";
            }

            DataTable yqlj = new sql().GetFriendLink(3);
            string stryqlj = "";
            for (int i = 0; i < yqlj.Rows.Count; i++)
            {
                stryqlj += "<li><a target='_blank' href='" + yqlj.Rows[i]["fl_url"].ToString() + "'>" + yqlj.Rows[i]["fl_title"].ToString() + "</a></li>";
            }
        
            string mbPath = Server.MapPath("/upload/html/Talent.html");
            Encoding code = Encoding.GetEncoding("gb2312");
            StreamReader sr = null;
            StreamWriter sw = null;
            string str = null;

            int ret = 0;

            //读取
            try
            {
                sr = new StreamReader(mbPath, code);
                str = sr.ReadToEnd();
            }
            catch (Exception ex)
            {
                ret = -1;
            }
            finally
            {
                sr.Close();
            }

            str = str.Replace("$lbtp$", strlbtp);
            str = str.Replace("$gzdt$", strgzdt);
            str = str.Replace("$zcwj$", strzcwj);
            str = str.Replace("$cypt$", strcypt);
            str = str.Replace("$rcxq$", strrcxq);
            str = str.Replace("$wtjd$", strwtjd);
            str = str.Replace("$yqlj$", stryqlj);
            //生成静态文件
            try
            {
                sw = new StreamWriter(Server.MapPath("../../Web/Talent/Index.html"), false, code);
                sw.Write(str);
                sw.Flush();
            }
            catch (Exception ex)
            {
                ret = -1;
            }
            finally
            {
                sw.Close();
            }
            if (ret != -1)
            {
                Response.Write(1);
            }
            else
                Response.Write(-1);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /******************档案管理********************/
    /// <summary>
    /// 档案列表
    /// </summary>
    public void GetArchivesList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string type = Request["type"];
            string state = Request["state"];
            string key = Request["key"];

            where = " ar_no>0 ";
            if (!string.IsNullOrEmpty(type) && !"-1".Equals(type))
            {
                where += " and ar_type=" + type;
            }
            if (!string.IsNullOrEmpty(state) && !"-1".Equals(state))
            {
                where += " and ar_state=" + state;
            }
            if (!string.IsNullOrEmpty(key))
            {
                where += " and ar_name like '%" + key + "%'";
            }
            DataTable dt = new sql().PagingTable(" Archives ", " * ", where, sortField, sortOrder, pageSize, pageIndex, " ar_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    //重置密码
    public void ResetPass()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "102");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["cuno"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().ResetPass(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    //档案信息上传
    public void ArchiveUpload()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "503");
            if (!flg)
            {
                Response.Write("no");
                return;
            }

            // 获得程序路径
            string filePath = System.Configuration.ConfigurationManager.AppSettings["Upload"];
            //找到目标文件对象
            HttpPostedFile uploadFile = Request.Files["Fdata"];

            // 如果有文件, 则保存到一个地址
            if (uploadFile.ContentLength > 0)
            {
                //获取要保存的文件信息
                FileInfo file = new FileInfo(uploadFile.FileName);

                //获得文件扩展名
                string fileNameExt = file.Extension;

                //新文件名称
                string fileName = GetFileName() + fileNameExt;

                if (".xls".Equals(fileNameExt))
                {
                    //保存的文件路径
                    filePath = Server.MapPath(filePath + "dangan/");
                    if (!Directory.Exists(filePath))
                        Directory.CreateDirectory(filePath);

                    uploadFile.SaveAs(filePath + fileName);

                    DataTable dt = GetExcelData(filePath + fileName);
                    int ret = 0;
                    if(dt != null && dt.Rows.Count>0)
                        ret = new sql().SaveArchives(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, dt);

                    Response.Write(ret);
                }
                else
                    Response.Write(-2);
            }
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    private string GetFileName()
    {
        Random rd = new Random();
        StringBuilder sb = new StringBuilder();
        sb.Append(DateTime.Now.ToString("yyyyMMddHHmmssff"));
        sb.Append(rd.Next(0, 999999).ToString());
        return sb.ToString();
    }

    private DataTable GetExcelData(string filepath)
    {
        //string strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filepath + ";Extended Properties='Excel 8.0;HDR=YES;IMEX=1'";
        //string strCon = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + filepath + ";Extended Properties='Excel 12.0;HDR=YES'";
        string strCon = ConfigurationManager.AppSettings["Excel1"].ToString() + filepath + ConfigurationManager.AppSettings["Excel2"].ToString();
        OleDbConnection ExcelConn = new OleDbConnection(strCon);
        try
        {
            ExcelConn.Open();
            DataTable sheetNames = ExcelConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new object[] { null, null, null, "TABLE" });
            string strCom = string.Format("SELECT * FROM [" + sheetNames.Rows[0]["TABLE_NAME"].ToString() + "]");
            OleDbDataAdapter myCommand = new OleDbDataAdapter(strCom, ExcelConn);
            DataTable dt = new DataTable();
            myCommand.Fill(dt);
            ExcelConn.Close();
            return dt;
        }
        catch (Exception ex)
        {
            ExcelConn.Close();
            throw ex;
        }
    }

    //分数上传
    public void ScoreUpload()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "309");
            if (!flg)
            {
                Response.Write("no");
                return;
            }

            // 获得程序路径
            string filePath = System.Configuration.ConfigurationManager.AppSettings["Upload"];
            //找到目标文件对象
            HttpPostedFile uploadFile = Request.Files["Fdata"];

            // 如果有文件, 则保存到一个地址
            if (uploadFile.ContentLength > 0)
            {
                //获取要保存的文件信息
                FileInfo file = new FileInfo(uploadFile.FileName);

                //获得文件扩展名
                string fileNameExt = file.Extension;

                //新文件名称
                string fileName = GetFileName() + fileNameExt;

                if (".xls".Equals(fileNameExt))
                {
                    //保存的文件路径
                    string table = filePath + "shiyedanwei/";
                    filePath = Server.MapPath(filePath + "shiyedanwei/");
                    if (!Directory.Exists(filePath))
                        Directory.CreateDirectory(filePath);

                    uploadFile.SaveAs(filePath + fileName);

                    DataTable dt = GetExcelData(filePath + fileName);
                    int ret = 0;
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        //ret = new sql().SaveScore(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, dt);

                        //Hashtable data = new Hashtable();
                        string json = Request["json"];
                        Hashtable data = (Hashtable)JSON.Decode(json);
                        data["ex_no"] = "";
                        data["ex_table"] = table + fileName;
                        data["user"] = Session["su_no"];
                        data["ip"] = Request.UserHostAddress;
                        data["name"] = Session["su_login"];

                        ret = new sql().SaveExam(data);
                    }

                    Response.Write(ret);
                }
                else
                    Response.Write(-2);
            }
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    public void GetExamList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);

            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string key = Request["key"];
            if (!string.IsNullOrEmpty(key))
                where += " ex_title like '%" + key + "%'";
            DataTable dt = new sql().PagingTable(" exam left join systemuser on ex_user=su_no ", " * ", where, sortField, sortOrder, pageSize, pageIndex, " ex_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 显示/隐藏分数
    /// </summary>
    public void LockExam()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "309");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().LockExam(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    public void GetScoreList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string key = Request["key"];
            string filepath = Request["filepath"];
            if (!string.IsNullOrEmpty(key))
                where = " WHERE 姓名 like '%" + key + "%' or 身份证号 like '%" + key + "%' or 准考证号 like '%" + key + "%'";

            string strCon = ConfigurationManager.AppSettings["Excel1"].ToString() + filepath + ConfigurationManager.AppSettings["Excel2"].ToString();
            OleDbConnection ExcelConn = new OleDbConnection(strCon);
            DataTable dt = new DataTable();
            try
            {
                ExcelConn.Open();
                DataTable sheetNames = ExcelConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new object[] { null, null, null, "TABLE" });
                string strCom = string.Format("SELECT * FROM [" + sheetNames.Rows[0]["TABLE_NAME"].ToString() + "] " + where);
                OleDbDataAdapter myCommand = new OleDbDataAdapter(strCom, ExcelConn);
                myCommand.Fill(dt);
                ExcelConn.Close();
            }
            catch (Exception ex)
            {
                ExcelConn.Close();
            }

            DataTable data = new DataTable();
            int start = pageIndex * pageSize, end = start + pageSize;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (start <= i && i < end)
                {
                    DataRow dr = data.NewRow();
                    data.Rows.Add(dt.Rows[i]);
                }
            }

            Hashtable result = new Hashtable();
            result["data"] = data;
            result["total"] = dt.Rows.Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    public void GetFindWorkList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = " pi_state=1 ";
            string key = Request["key"];
            if (!string.IsNullOrEmpty(key))
                where += " and (pi_user like '%" + key + "%' or pi_name like '%" + key + "%')";
            DataTable dt = new sql().PagingTable(" findwork left join personinfor on fw_pino=pi_no ", " fw_no,fw_pino,pi_no,pi_user,pi_name,fw_mobile,(select count(1) from receiveperson where rp_pino=fw_pino) as fw_count ", where, sortField, sortOrder, pageSize, pageIndex, " fw_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    public void SaveMobileMsgs()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "69");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
            {
                string json = Request["data"];
                Hashtable data = (Hashtable)JSON.Decode(json);
                data["pi_no"] = id.Trim(',');
                data["user"] = Session["su_no"];
                data["ip"] = Request.UserHostAddress;
                data["name"] = Session["su_login"];
                ret = new sql().SaveMobileMsg(data);
            }
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    public void SendMobileMsgs()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1401");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().SendMobileMsg(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    public void GetPersonName()
    {
        string id = Request["id"];
        string name = new sql().GetPersonName(id);
        Response.Write(name);
    }

    public void GetMobileMsgList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string pino = Request["pino"];
            DataTable dt = new DataTable();
            if (!string.IsNullOrEmpty(pino))
            {
                where += " fw_pino=" + pino;
                dt = new sql().PagingTable(" receiveperson left join findwork on rp_pino=fw_pino left join personinfor on rp_pino=pi_no left join mobilemsg on rp_mmno=mm_no left join systemuser on mm_user=su_no ", " rp_no,rp_mmno,rp_pino,mm_title,mm_memo,mm_sendtime,su_login ", where, sortField, sortOrder, pageSize, pageIndex, " rp_no ", out Count);
            }
            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    public void SaveMobileMsg()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1401");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            int ret = -1;
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["user"] = Session["su_no"];
            data["ip"] = Request.UserHostAddress;
            data["name"] = Session["su_login"];
            ret = new sql().SaveMobileMsg(data);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    public void SendMobileMsg()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1401");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().SendMobileMsg(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 保存新闻资讯
    /// </summary>
    public void SaveHRNews()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "1001,1002");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["nw_content"] = Request["content"];
            data["user"] = Session["su_no"];
            data["ip"] = Request.UserHostAddress;
            data["name"] = Session["su_login"];
            data["nw_orderid"] = false;

            int ret = new sql().SaveNews(data);
            if (ret > 0)
                CreateHRHtml();
            else
                Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
    /// <summary>
    /// 岗位延期
    /// </summary>
    public void SRecruitDelay()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "1=1 ";
            string table = "";
            string type = Request["type"];
            string sdate = Request["sdate"];
            string edate = Request["edate"];

            if (!string.IsNullOrEmpty(type) && !"0".Equals(type))
            {
                where += " and re_jobtype1=" + type;
                table = " recruitrefresh  left join recruit on re_no=rr_reno inner join jobtype on jt_id=re_jobtype11 ";
            }
            else
            {
                //where += " and jt_pid='0'";
                table = " recruitrefresh  left join recruit on re_no=rr_reno inner join jobtype on jt_id=re_jobtype1 ";
            }
            if (!string.IsNullOrEmpty(sdate))
                where += " and re_inserttime>='" + sdate + "'";
            if (!string.IsNullOrEmpty(edate))
                where += " and re_inserttime<='" + edate + "'";
            string groupby = " jt_id,jt_name ";
            DataTable dt = new sql().PagingTable(table, " jt_id,jt_name,count(rr_reno) as re_count,(cast((cast(count(rr_reno) as float)*100/(select case when count(rr_reno)=0 then 1 else count(rr_reno) end from " + table + " where " + where + ")) as numeric(5,2))) as re_percent ", where, groupby, sortField, sortOrder, pageSize, pageIndex, " rr_reno ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            DataTable dt1 = new sql().GetDelayJobCount(table, where);
            if (dt1 != null && dt1.Rows.Count > 0)
                result["jobcount"] = dt1.Rows[0]["jobcount"].ToString();
            else
                result["jobcount"] = 0;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 橱窗招聘
    /// </summary>
    public void GetShopWindowList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string key = Request["key"];
            string state = Request["state"];
            string sdate = Request["sdate"];
            string edate = Request["edate"];

            where = " 1=1 ";
            if (!string.IsNullOrEmpty(key))
                where += " and sw_name  like '%" + key + "%'";
            if (!string.IsNullOrEmpty(state) && !"-1".Equals(state))
                where += " and sw_state=" + state;
            if (!string.IsNullOrEmpty(sdate))
                where += " and sw_inserttime>='" + sdate + "'";
            if (!string.IsNullOrEmpty(edate))
                where += " and sw_inserttime<='" + edate + "'";

            DataTable dt = new sql().PagingTable(" shopwindow left join companyuser on cu_no=sw_cuno ", " * ,DATEADD(DAY,cu_effecttime,cu_apptime) as cu_endtime", where, sortField, sortOrder, pageSize, pageIndex, " sw_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 删除橱窗招聘
    /// </summary>
    public void DeleteShopWindow()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "106");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteShopWindow(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 审核橱窗招聘
    /// </summary>
    public void CheckShopWindow()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "106");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().CheckShopWindow(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 见习实习基地列表
    /// </summary>
    public void GetBaseList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = " cu_base in (1,2) ";
            string key = Request["key"];
            string area = Request["area"];

            if (!string.IsNullOrEmpty(key))
                where += " and (cu_name like '%" + key + "%' or cu_user like '%" + key + "%')";
            if (!string.IsNullOrEmpty(area) && !"0".Equals(area))
                where += " and cu_area='" + area + "'";
            DataTable dt = new sql().PagingTable(" companyuser ", " *,(select count(1) from internship where is_cuno=cu_no) as is_count,(select di_name from dictionary where di_code=cu_trade and di_type=1) as trade,(select di_name from dictionary where di_code=cu_property and di_type=2) as property,(select di_name from dictionary where di_code=cu_area and di_type=3) as area ", where, sortField, sortOrder, pageSize, pageIndex, " cu_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 保存基地企业
    /// </summary>
    public void SaveBase()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "704");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["user"] = Session["su_no"];
            data["ip"] = Request.UserHostAddress;
            data["name"] = Session["su_login"];

            int ret = new sql().SaveBase(data);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    //基地企业重置密码
    public void ResetBasePass()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "704");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["user"] = Session["su_no"];
            data["ip"] = Request.UserHostAddress;
            data["name"] = Session["su_login"];
            int ret = new sql().ResetBasePass(data);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 见习实习岗位列表
    /// </summary>
    public void GetInternList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string cuno = Request["cuno"];
            string key = Request["key"];
            string type = Request["type"];

            if (!string.IsNullOrEmpty(cuno))
                where = " is_cuno= " + cuno;
            else
                where = " is_name like '%" + key + "%' ";
            if (!string.IsNullOrEmpty(type) && !"-1".Equals(type))
            {
                if ("0".Equals(type))
                    where += " and is_state=0";
                else if ("1".Equals(type))
                    where += " and is_state=1";
                else if ("2".Equals(type))
                    where += " and is_state=2";
                else if ("3".Equals(type))
                    where += " and is_hide=0";
                else if ("4".Equals(type))
                    where += " and is_hide=1";
                else if ("5".Equals(type))
                    where += " and is_delete=1";
            }
            DataTable dt = new sql().PagingTable(" internship left join companyuser on cu_no=is_cuno ", " *,DATEADD(DAY,is_effect,is_modifytime) as is_endtime ", where, sortField, sortOrder, pageSize, pageIndex, " is_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }

    /// <summary>
    /// 获取见习实习岗位
    /// </summary>
    public void GetIntern()
    {
        string id = Request["id"];
        Hashtable data = new sql().GetIntern(id);
        string json = JSON.Encode(data);
        Response.Write(json);
    }

    /// <summary>
    /// 保存见习实习岗位
    /// </summary>
    public void SaveIntern()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "704,705");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["user"] = Session["su_no"];
            data["ip"] = Request.UserHostAddress;
            data["name"] = Session["su_login"];

            int ret = new sql().SaveIntern(data);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除见习实习岗位
    /// </summary>
    public void DeleteIntern()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "705");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteIntern(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 审核见习实习岗位
    /// </summary>
    public void CheckIntern()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "705");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().CheckIntern(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 隐藏/显示见习实习岗位
    /// </summary>
    public void LockIntern()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "705");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().LockIntern(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 归零见习实习岗位点击率
    /// </summary>
    public void ZeroIntern()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "705");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().ZeroIntern(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 刷新见习实习岗位
    /// </summary>
    public void RefreshIntern()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "705");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().RefreshIntern(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 上传视频
    /// </summary>
    public void GetVideoList()
    {
        try
        {
            int Count = 0;
            int pageIndex = Convert.ToInt32(Request["pageIndex"]);
            pageIndex = pageIndex + 1;
            string sortField = Request["sortField"];
            string sortOrder = Request["sortOrder"];
            int pageSize = Convert.ToInt32(Request["pageSize"]);
            string where = "";
            string key = Request["key"];
            string state = Request["state"];

            where += " uv_title like '%" + key + "%'";
            if (!string.IsNullOrEmpty(state))
                where += " and uv_hide=" + state;
            DataTable dt = new sql().PagingTable(" UploadVideo left join systemuser on su_no=uv_insertuser ", " *,(select su_login from systemuser where su_no=uv_imodifyuser) as modifylogin ", where, sortField, sortOrder, pageSize, pageIndex, " uv_no ", out Count);

            Hashtable result = new Hashtable();
            result["data"] = dt;
            result["total"] = Count;
            string json = JSON.Encode(result);
            Response.Write(json);
        }
        catch (Exception e)
        {
            // Response.Write('失败');
        }
    }


    /// <summary>
    /// 获取上传视频
    /// </summary>
    public void GetVideo()
    {
        string id = Request["id"];
        Hashtable data = new sql().GetVideo(id);
        string json = JSON.Encode(data);
        Response.Write(json);
    }

    /// <summary>
    /// 保存上传视频
    /// </summary>
    public void SaveVideo()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "111");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string json = Request["data"];
            Hashtable data = (Hashtable)JSON.Decode(json);
            data["uv_no"] = Request["id"];
            data["uv_img"] = "";// Request["img"];
            data["uv_video"] = Request["file"];
            data["user"] = Session["su_no"];
            data["ip"] = Request.UserHostAddress;
            data["name"] = Session["su_login"];

            int ret = new sql().SaveVideo(data);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 删除上传视频
    /// </summary>
    public void DeleteVideo()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "111");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().DeleteVideo(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','));
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }

    /// <summary>
    /// 隐藏/显示上传视频
    /// </summary>
    public void LockVideo()
    {
        try
        {
            bool flg = new sql().CheckPower(Session["su_no"].ToString(), "111");
            if (!flg)
            {
                Response.Write("no");
                return;
            }
            string id = Request["id"];
            string state = Request["state"];
            int ret = -1;
            if (!string.IsNullOrEmpty(id))
                ret = new sql().LockVideo(Session["su_no"].ToString(), Session["su_login"].ToString(), Request.UserHostAddress, id.Trim(','), state);
            Response.Write(ret);
        }
        catch (Exception e)
        {
            Response.Write(-1);
        }
    }
}